From 51a8193c16e05e3862e22fd086c5900d8422890c Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Mon, 8 Jun 2020 10:02:49 +0200 Subject: [PATCH] wayland/keyboard: Fix anonymous file leak on repeated keymap changes keymap_rofile was being overwritten without the old one being free'd on repeated calls of meta_wayland_keyboard_take_keymap(). https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1304 --- src/wayland/meta-wayland-keyboard.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index dbc53c29f..0824007ad 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -147,6 +147,7 @@ meta_wayland_keyboard_take_keymap (MetaWaylandKeyboard *keyboard, } keymap_size = strlen (keymap_string) + 1; + g_clear_pointer (&xkb_info->keymap_rofile, meta_anonymous_file_free); xkb_info->keymap_rofile = meta_anonymous_file_new (keymap_size, (const uint8_t *) keymap_string);