diff options
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 96b33ea7d..46686b754 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -1327,14 +1327,18 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) dev->focus = NULL; } - for (k = dev->kbdfeed; k; k = knext) + if (dev->kbdfeed) { - knext = k->next; - #ifdef XKB - if (k->xkb_sli) - XkbFreeSrvLedInfo(k->xkb_sli); - #endif - free(k); + for (k = dev->kbdfeed; k; k = knext) + { + knext = k->next; + #ifdef XKB + if (k->xkb_sli) + XkbFreeSrvLedInfo(k->xkb_sli); + #endif + free(k); + } + dev->kbdfeed = NULL; } #ifdef DEBUG |