summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-02-11 15:27:26 +1000
committerJakob Bornecrantz <add>2013-10-21 10:39:45 +0200
commit9a815289f9df5577f5fdf4c2463b614a93819b7d (patch)
tree9405b627d5d113bf77f52a26aadeff9e9f74ae76
parent3d5b85d62c11a9f816dbcc041cb2ac2150af666d (diff)
Don't de-reference pMse if it hasn't been initialised yet
If the device fails PreInit, UnInit is still called by pMse may be NULL. Dereferencing it is a bad idea. Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/vmmouse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vmmouse.c b/src/vmmouse.c
index fb053c2..523f4fd 100644
--- a/src/vmmouse.c
+++ b/src/vmmouse.c
@@ -808,11 +808,13 @@ static void
VMMouseUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
{
MouseDevPtr pMse = pInfo->private;
- VMMousePrivPtr mPriv = (VMMousePrivPtr)pMse->mousePriv;
xf86Msg(X_INFO, "VMWARE(0): VMMouseUnInit\n");
- free(mPriv);
+ if (pMse) {
+ VMMousePrivPtr mPriv = (VMMousePrivPtr)pMse->mousePriv;
+ free(mPriv);
+ }
xf86DeleteInput(pInfo, flags);
}