summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-11 15:45:46 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-11 15:54:12 +1000
commitac13145dbcb284293582435409d8a90f276785c5 (patch)
tree8c1bd8c6569e4438e2b697c0093b59bb357248c1 /xkb
parentc2b668e6fff11c52f2a3f0dc3f4d1fc2c5bcf3e6 (diff)
xkb: if kbd init failed, NULL out the pointers after freeing them (#21278)
Reproducible: Configure a server that uses the keyboard driver with an invalid ruleset, e.g. (Option "XkbRules" "foobar"). Ensure that Option "AllowEmptyInput" is "off" in the ServerFlags or ServerLayout section. Start the server. After failing to init the keymap, the server will try to clean up after the device, double-freeing some xkb structs that have not been reset properly. X.Org Bug 21278 <http://bugs.freedesktop.org/show_bug.cgi?id=21278> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkbInit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index bea8ce0cc..e707f7ad3 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -622,10 +622,13 @@ unwind_desc:
XkbFreeKeyboard(xkb, 0, TRUE);
unwind_info:
xfree(xkbi);
+ dev->key->xkbInfo = NULL;
unwind_kbdfeed:
xfree(dev->kbdfeed);
+ dev->kbdfeed = NULL;
unwind_key:
xfree(dev->key);
+ dev->key = NULL;
return FALSE;
}