summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorRami Ylimäki <rami.ylimaki@vincit.fi>2011-03-04 17:55:31 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2011-03-09 07:59:40 +1000
commit40e56d34538f4663426db50893c231a2b5d760dc (patch)
tree24890c0be4c65b31cecd9c216c9fb70040f52068 /xkb
parent18413f55089623123537c1499b02aa95ca2014d2 (diff)
xkb: Ensure that XKB device private won't leak on device disconnect.
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkbActions.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 65c678af8..c4336d7b4 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -68,20 +68,13 @@ xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc,
Bool
XkbInitPrivates(void)
{
- return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, 0);
+ return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, sizeof(xkbDeviceInfoRec));
}
void
XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
{
- xkbDeviceInfoPtr xkbPrivPtr;
-
- xkbPrivPtr = (xkbDeviceInfoPtr) calloc(1, sizeof(xkbDeviceInfoRec));
- if (!xkbPrivPtr)
- return;
- xkbPrivPtr->unwrapProc = NULL;
-
- dixSetPrivate(&device->devPrivates, xkbDevicePrivateKey, xkbPrivPtr);
+ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device);
WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, proc, xkbUnwrapProc);
}