summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vmmouse.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/vmmouse.c b/src/vmmouse.c
index 32abd9e..9d366e2 100644
--- a/src/vmmouse.c
+++ b/src/vmmouse.c
@@ -268,15 +268,6 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
}
#endif
- mPriv = calloc (1, sizeof (VMMousePrivRec));
-
-
- if (!mPriv) {
- return NULL;
- }
-
- mPriv->absoluteRequested = FALSE;
-
/*
* try to enable vmmouse here
*/
@@ -286,13 +277,11 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
* Fall back to normal mouse module
*/
xf86Msg(X_ERROR, "VMWARE(0): vmmouse enable failed\n");
- free(mPriv);
return VMMouseInitPassthru(drv, dev, flags);
} else {
/*
* vmmouse is available
*/
- mPriv->vmmouseAvailable = TRUE;
xf86Msg(X_INFO, "VMWARE(0): vmmouse is available\n");
/*
* Disable the absolute pointing device for now
@@ -302,10 +291,19 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
}
if (!(pInfo = xf86AllocateInput(drv, 0))) {
- free(mPriv);
return NULL;
}
+ mPriv = calloc (1, sizeof (VMMousePrivRec));
+
+ if (!mPriv) {
+ xf86DeleteInput(pInfo, 0);
+ return NULL;
+ }
+
+ mPriv->absoluteRequested = FALSE;
+ mPriv->vmmouseAvailable = TRUE;
+
/* Settup the pInfo */
pInfo->name = dev->identifier;
pInfo->type_name = XI_MOUSE;