aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/events.c')
-rw-r--r--xorg-server/dix/events.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 3c3febdc5..74d05f95b 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -3965,6 +3965,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 */
@@ -5061,7 +5063,7 @@ ProcUngrabPointer(ClientPtr client)
* @param other_mode GrabModeSync or GrabModeAsync
* @param status Return code to be returned to the caller.
*
- * @returns Success or BadValue.
+ * @returns Success or BadValue or BadAlloc.
*/
int
GrabDevice(ClientPtr client, DeviceIntPtr dev,
@@ -5142,6 +5144,8 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
GrabPtr tempGrab;
tempGrab = AllocGrab(NULL);
+ if (tempGrab == NULL)
+ return BadAlloc;
tempGrab->next = NULL;
tempGrab->window = pWin;