From 186fca07c5bbdde4e208e019090724dd938400b8 Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 11 Mar 2019 20:38:49 +0100 Subject: control-center: Fix memory leak Reported by clang: control-center.c:84:2: warning: Potential leak of memory pointed to by 'action' g_slist_free(key_list); ^~~~~~~~~~~~ --- libslab/app-shell.h | 2 +- shell/control-center.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libslab/app-shell.h b/libslab/app-shell.h index 6b968763..9db7a9d1 100644 --- a/libslab/app-shell.h +++ b/libslab/app-shell.h @@ -112,7 +112,7 @@ typedef struct typedef struct { - const gchar *name; + gchar *name; MateDesktopItem *item; } AppAction; diff --git a/shell/control-center.c b/shell/control-center.c index 55c4246d..20d2012b 100644 --- a/shell/control-center.c +++ b/shell/control-center.c @@ -70,6 +70,8 @@ static GSList* get_actions_list(void) if ((action->item = load_desktop_item_from_unknown(temp[1])) == NULL) { + g_free (action->name); + g_free (action); g_warning("get_actions_list() - PROBLEM - Can't load %s\n", temp[1]); } else -- cgit v1.2.1