aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/XKBGetByName.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/X11/XKBGetByName.c')
-rw-r--r--nx-X11/lib/X11/XKBGetByName.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nx-X11/lib/X11/XKBGetByName.c b/nx-X11/lib/X11/XKBGetByName.c
index 4a6ca9392..c673781ed 100644
--- a/nx-X11/lib/X11/XKBGetByName.c
+++ b/nx-X11/lib/X11/XKBGetByName.c
@@ -44,7 +44,7 @@ XkbGetKeyboardByName(Display *dpy,
{
register xkbGetKbdByNameReq *req;
xkbGetKbdByNameReply rep;
- int len, extraLen;
+ int len, extraLen = 0;
char *str;
XkbDescPtr xkb;
int mapLen, codesLen, typesLen, compatLen;
@@ -204,12 +204,16 @@ XkbGetKeyboardByName(Display *dpy,
if (status != Success)
goto BAILOUT;
}
+ if (extraLen > 0)
+ goto BAILOUT;
UnlockDisplay(dpy);
SyncHandle();
return xkb;
BAILOUT:
if (xkb != NULL)
XkbFreeKeyboard(xkb, XkbAllComponentsMask, xTrue);
+ if (extraLen > 0)
+ _XEatData(dpy, extraLen);
UnlockDisplay(dpy);
SyncHandle();
return NULL;