aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/dix
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-06-17 18:15:05 +0200
committerUlrich Sibiller <uli42@gmx.de>2019-06-19 00:49:57 +0200
commitca741177e8a36f0eb5e84a047681bfd2edd3e3ba (patch)
tree5a3c50931daa99b662e6d54e92b8e86689a24c33 /nx-X11/programs/Xserver/dix
parent340de78e26e7837561909ae2a44c2ef85863d87b (diff)
downloadnx-libs-ca741177e8a36f0eb5e84a047681bfd2edd3e3ba.tar.gz
nx-libs-ca741177e8a36f0eb5e84a047681bfd2edd3e3ba.tar.bz2
nx-libs-ca741177e8a36f0eb5e84a047681bfd2edd3e3ba.zip
CloseDevice: call XkbRemoveResourceClient before freeing key class struct
This patch is not necessary at the current code level. But when xkb code introduced the dev->key check Xorg upstream missed that. So we backport it now to skip that trap when updating xkb code. Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Jan 4 18:21:54 2010 -0800 CloseDevice: call XkbRemoveResourceClient before freeing key class struct XkbRemoveResourceClient() returns immediately if dev->key is NULL. CloseDevice calls XkbRemoveResourceClient until it removes all resources. If we free dev->key and NULL it before XkbRemoveResourceClient, then infinite loop ensues, and the server appears to hang on exit or crash. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/programs/Xserver/dix')
-rw-r--r--nx-X11/programs/Xserver/dix/devices.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c
index 51cf3fef9..8ad1cc371 100644
--- a/nx-X11/programs/Xserver/dix/devices.c
+++ b/nx-X11/programs/Xserver/dix/devices.c
@@ -203,7 +203,15 @@ CloseDevice(register DeviceIntPtr dev)
if (dev->inited)
(void)(*dev->deviceProc)(dev, DEVICE_CLOSE);
+
+#ifdef XKB
+ while (dev->xkb_interest) {
+ XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
+ }
+#endif
+
free(dev->name);
+
if (dev->key)
{
#ifdef XKB
@@ -267,11 +275,6 @@ CloseDevice(register DeviceIntPtr dev)
#endif
free(l);
}
-#ifdef XKB
- while (dev->xkb_interest) {
- XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
- }
-#endif
free(dev->sync.event);
free(dev);
}