diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2018-07-16 22:23:05 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-11-09 15:31:57 +0100 |
commit | d8bbbcf29c3c0e43ce28d76e52e6a8ad9deeb90f (patch) | |
tree | 4be04fe53c0c926ec895355288420e6ef34029b1 /nx-X11 | |
parent | 1b05251a02f2fbac09fb267f0c7fcb411c7e0105 (diff) | |
download | nx-libs-d8bbbcf29c3c0e43ce28d76e52e6a8ad9deeb90f.tar.gz nx-libs-d8bbbcf29c3c0e43ce28d76e52e6a8ad9deeb90f.tar.bz2 nx-libs-d8bbbcf29c3c0e43ce28d76e52e6a8ad9deeb90f.zip |
Keyboard.c: guard XkbFreeKeyboard calls
manpage does not tell us if NULL is valid
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 65c4d20fe..84121c1db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -723,8 +723,11 @@ XkbError: fprintf(stderr, "nxagentKeyboardProc: XKB error.\n"); #endif - XkbFreeKeyboard(xkb, XkbAllComponentsMask, True); - xkb = NULL; + if (xkb) + { + XkbFreeKeyboard(xkb, XkbAllComponentsMask, True); + xkb = NULL; + } free(model); free(layout); @@ -874,14 +877,16 @@ XkbError: goto XkbError; } -XkbEnd: if (nxagentOption(Shadow) == 1 && pDev && pDev->key) { NXShadowInitKeymap(&(pDev->key->curKeySyms)); } - XkbFreeKeyboard(xkb, XkbAllComponentsMask, True); - xkb = NULL; + if (xkb) + { + XkbFreeKeyboard(xkb, XkbAllComponentsMask, True); + xkb = NULL; + } free(model); free(layout); |