diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2020-01-02 21:10:40 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-01-05 21:44:12 +0100 |
commit | bbe2c2ab97b9882738b9ea985b5e1a3f86006999 (patch) | |
tree | 3ba815df3997d28d88e4d347924c2603ac9cfdd7 /nx-X11 | |
parent | cf24c658a41b1a5a540506b62ba95fb3cc8a9737 (diff) | |
download | nx-libs-bbe2c2ab97b9882738b9ea985b5e1a3f86006999.tar.gz nx-libs-bbe2c2ab97b9882738b9ea985b5e1a3f86006999.tar.bz2 nx-libs-bbe2c2ab97b9882738b9ea985b5e1a3f86006999.zip |
Keyboard.c: fix: handle empty string
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 0ebaf677b..756613ab1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -549,6 +549,12 @@ XkbError: XkbComponentNamesRec names = {0}; char *rules = NULL, *variant = NULL, *options = NULL; /* use xkb default */ + /* handle empty string like the NULL pointer */ + if (nxagentKeyboard && nxagentKeyboard[0] == '\0') + { + SAFE_free(nxagentKeyboard); + } + #ifdef TEST fprintf(stderr, "nxagentKeyboardProc: Using XKB extension.\n"); fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL"); |