diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-05-09 14:30:49 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-05-10 11:04:53 +1000 |
commit | 8a88b0ab52ba375ae84463a90503db88af10e368 (patch) | |
tree | 3f6305143e359c4f2a2df3673a1fa0d692f6e281 /xkb | |
parent | 34b0d07ebf4a7874fe7fd336bef5bbdd8debda1c (diff) |
dix: don't overwrite proximity/focus classes
InitPointerClassDeviceStruct/InitKeyboardDeviceStruct allocate a
proximity/focus class, respectively. If a driver calls
InitFocusClassDeviceStruct or InitProximityClassDeviceStruct beforehand,
the previously allocated class is overwritten, leaking the memory.
Neither takes a parameter other than the device, so we can simply skip
initialising it if we already have one.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/xkbInit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 244c353c6..573c4ff1d 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -589,7 +589,8 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, XkbUpdateActions(dev, xkb->min_key_code, XkbNumKeys(xkb), &changes, &check, &cause); - InitFocusClassDeviceStruct(dev); + if (!dev->focus) + InitFocusClassDeviceStruct(dev); xkbi->kbdProc = ctrl_func; dev->kbdfeed->BellProc = bell_func; |