diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-02-11 15:27:26 +1000 |
---|---|---|
committer | Jakob Bornecrantz <add> | 2013-10-21 10:39:45 +0200 |
commit | 9a815289f9df5577f5fdf4c2463b614a93819b7d (patch) | |
tree | 9405b627d5d113bf77f52a26aadeff9e9f74ae76 /src/vmmouse.c | |
parent | 3d5b85d62c11a9f816dbcc041cb2ac2150af666d (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>
Diffstat (limited to 'src/vmmouse.c')
-rw-r--r-- | src/vmmouse.c | 6 |
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); } |