From caacec3c8654d4f4bdc360f90f2f722b9c2cdb91 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Sat, 17 Oct 2015 21:21:22 +0200 Subject: [PATCH] keyboard: Fix leak when loading sections This fixes: ==5944== 2,304 bytes in 5 blocks are definitely lost in loss record 15,724 of 16,045 ==5944== at 0x4C2AB9D: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==5944== by 0x1445F0B8: g_realloc (gmem.c:159) ==5944== by 0x144217CF: g_array_maybe_expand (garray.c:779) ==5944== by 0x14420C9F: g_array_append_vals (garray.c:418) ==5944== by 0x48ACFA: append_sections_from_file (keyboard-shortcuts.c:558) ==5944== by 0x48B4EE: reload_sections (keyboard-shortcuts.c:737) ==5944== by 0x48EA22: keyboard_shortcuts_init (keyboard-shortcuts.c:2109) ==5944== by 0x489236: cc_keyboard_panel_constructor (cc-keyboard-panel.c:133) ==5944== by 0x141C7C3F: g_object_new_with_custom_constructor (gobject.c:1697) ==5944== by 0x141C7E71: g_object_new_internal (gobject.c:1777) ==5944== by 0x141C8ADA: g_object_new_valist (gobject.c:2038) ==5944== by 0x141C7A85: g_object_new (gobject.c:1622) ==5944== by 0x4547DF: cc_panel_loader_load_by_name (cc-panel-loader.c:213) ==5944== by 0x44DFCB: activate_panel (cc-window.c:157) ==5944== by 0x4504D6: cc_window_set_active_panel_from_id (cc-window.c:1036) ==5944== by 0x44E6A6: item_activated_cb (cc-window.c:280) https://bugzilla.gnome.org/show_bug.cgi?id=756762 --- panels/keyboard/keyboard-shortcuts.c | 1 + 1 file changed, 1 insertion(+) diff --git a/panels/keyboard/keyboard-shortcuts.c b/panels/keyboard/keyboard-shortcuts.c index b8ab7ae26..fa0139267 100644 --- a/panels/keyboard/keyboard-shortcuts.c +++ b/panels/keyboard/keyboard-shortcuts.c @@ -590,6 +590,7 @@ append_sections_from_file (GtkBuilder *builder, const gchar *path, const char *d g_free (entry->name); g_free (entry->reverse_entry); } + g_free (keys); g_free (keylist); }