From 556388f373c0f1be860d371db91d88f0baac245d Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Fri, 29 Jun 2018 15:05:48 +1200 Subject: [PATCH] region: Fix small memory leak Was introduced in 79e00c3 --- panels/region/cc-region-panel.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c index d5848e57b..5795d1663 100644 --- a/panels/region/cc-region-panel.c +++ b/panels/region/cc-region-panel.c @@ -809,11 +809,7 @@ add_input_sources (CcRegionPanel *self, GVariant *sources) { GVariantIter iter; - const gchar *type; - const gchar *id; - const gchar *name; - g_autofree gchar *display_name = NULL; - g_autoptr(GDesktopAppInfo) app_info = NULL; + const gchar *type, *id; if (g_variant_n_children (sources) < 1) { add_no_input_row (self); @@ -822,10 +818,12 @@ add_input_sources (CcRegionPanel *self, g_variant_iter_init (&iter, sources); while (g_variant_iter_next (&iter, "(&s&s)", &type, &id)) { - display_name = NULL; - app_info = NULL; + g_autoptr(GDesktopAppInfo) app_info = NULL; + g_autofree gchar *display_name = NULL; if (g_str_equal (type, INPUT_SOURCE_TYPE_XKB)) { + const gchar *name; + gnome_xkb_info_get_layout_info (self->xkb_info, id, &name, NULL, NULL, NULL); if (!name) { g_warning ("Couldn't find XKB input source '%s'", id);