aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2018-07-16 22:23:05 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-11-09 15:31:57 +0100
commitd8bbbcf29c3c0e43ce28d76e52e6a8ad9deeb90f (patch)
tree4be04fe53c0c926ec895355288420e6ef34029b1 /nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
parent1b05251a02f2fbac09fb267f0c7fcb411c7e0105 (diff)
downloadnx-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/programs/Xserver/hw/nxagent/Keyboard.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c15
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);