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.]
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index 3518902..9f7dd2e 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -198,8 +198,7 @@ CompileKeymap(struct xkb_context *context, XkbFile *file, unsigned merge)
err:
ACTION("Failed to compile keymap\n");
- if (xkb)
- xkb_map_unref(xkb);
+ xkb_map_unref(xkb);
while (unbound) {
next = (LEDInfo *) unbound->defs.next;
free(unbound);