input: Don't leak the initial keymap
authorRui Matos <tiagomatos@gmail.com>
Thu, 24 Oct 2013 17:28:41 +0000 (19:28 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 9 Jan 2014 05:40:32 +0000 (21:40 -0800)
weston_xkb_info_create() takes ownership of the xkb_keymap instance so
we should drop our reference or we would leak it later if the keymap
was changed.

src/input.c

index 07e9d6c..902cfb8 100644 (file)
@@ -1954,6 +1954,7 @@ weston_compositor_build_global_keymap(struct weston_compositor *ec)
        }
 
        ec->xkb_info = weston_xkb_info_create(keymap);
+       xkb_keymap_unref(keymap);
        if (ec->xkb_info == NULL)
                return -1;