diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 4108e1b26..0178d4da3 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -542,7 +542,7 @@ InitKeyboardDeviceStructInternal(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, dev->key = calloc(1, sizeof(*dev->key)); if (!dev->key) { ErrorF("XKB: Failed to allocate key class\n"); - return FALSE; + goto unwind_rmlvo; } dev->key->sourceid = dev->id; @@ -661,6 +661,8 @@ InitKeyboardDeviceStructInternal(DeviceIntPtr dev, XkbRMLVOSet * rmlvo, unwind_key: free(dev->key); dev->key = NULL; + unwind_rmlvo: + XkbFreeRMLVOSet(&rmlvo_dflts, FALSE); return FALSE; }