CheckPassiveGrabsOnWindow() needs to handle NULL return value from AllocGrab()

CheckPassiveGrabsOnWindow() calls AllocGrab() which can fail and return NULL.
This return value is not checked, and can cause NULL pointer dereferences.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Alan Coopersmith 2014-01-06 17:10:40 -08:00 committed by Peter Hutterer
parent 5493a67ec2
commit 863d2ad5c0

View File

@ -3956,6 +3956,8 @@ CheckPassiveGrabsOnWindow(WindowPtr pWin,
return NULL;
tempGrab = AllocGrab(NULL);
if (tempGrab == NULL)
return NULL;
/* Fill out the grab details, but leave the type for later before
* comparing */