diff options
-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"); |