aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/ungrdevk.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xi/ungrdevk.c')
-rw-r--r--xorg-server/Xi/ungrdevk.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/xorg-server/Xi/ungrdevk.c b/xorg-server/Xi/ungrdevk.c
index 526347db4..b0d83cbbc 100644
--- a/xorg-server/Xi/ungrdevk.c
+++ b/xorg-server/Xi/ungrdevk.c
@@ -98,7 +98,7 @@ ProcXUngrabDeviceKey(ClientPtr client)
DeviceIntPtr dev;
DeviceIntPtr mdev;
WindowPtr pWin;
- GrabRec temporaryGrab;
+ GrabPtr temporaryGrab;
int rc;
REQUEST(xUngrabDeviceKeyReq);
@@ -133,17 +133,22 @@ ProcXUngrabDeviceKey(ClientPtr client)
(stuff->modifiers & ~AllModifiersMask))
return BadValue;
- temporaryGrab.resource = client->clientAsMask;
- temporaryGrab.device = dev;
- temporaryGrab.window = pWin;
- temporaryGrab.type = DeviceKeyPress;
- temporaryGrab.grabtype = GRABTYPE_XI;
- temporaryGrab.modifierDevice = mdev;
- temporaryGrab.modifiersDetail.exact = stuff->modifiers;
- temporaryGrab.modifiersDetail.pMask = NULL;
- temporaryGrab.detail.exact = stuff->key;
- temporaryGrab.detail.pMask = NULL;
-
- DeletePassiveGrabFromList(&temporaryGrab);
+ temporaryGrab = AllocGrab();
+ if (!temporaryGrab)
+ return BadAlloc;
+
+ temporaryGrab->resource = client->clientAsMask;
+ temporaryGrab->device = dev;
+ temporaryGrab->window = pWin;
+ temporaryGrab->type = DeviceKeyPress;
+ temporaryGrab->grabtype = GRABTYPE_XI;
+ temporaryGrab->modifierDevice = mdev;
+ temporaryGrab->modifiersDetail.exact = stuff->modifiers;
+ temporaryGrab->modifiersDetail.pMask = NULL;
+ temporaryGrab->detail.exact = stuff->key;
+ temporaryGrab->detail.pMask = NULL;
+
+ DeletePassiveGrabFromList(temporaryGrab);
+ FreeGrab(temporaryGrab);
return Success;
}