Avoid leak in CompileKeymap error path

The NULL check is unneeded, and prevented the atoms from being free'd.

Signed-off-by: Ran Benita <ran234@gmail.com>

[daniels: Updated for xkb_map_unref.]
master
Ran Benita 2012-03-31 02:30:33 +03:00 committed by Daniel Stone
parent 5c5f7fcb7c
commit 7a7ec9b14a
1 changed files with 1 additions and 2 deletions

View File

@ -198,8 +198,7 @@ CompileKeymap(struct xkb_context *context, XkbFile *file, unsigned merge)
err: err:
ACTION("Failed to compile keymap\n"); ACTION("Failed to compile keymap\n");
if (xkb) xkb_map_unref(xkb);
xkb_map_unref(xkb);
while (unbound) { while (unbound) {
next = (LEDInfo *) unbound->defs.next; next = (LEDInfo *) unbound->defs.next;
free(unbound); free(unbound);