From e7f0a4d17ac3bee6e7b7801ddffd98e4f6fea37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Mon, 1 Apr 2019 10:59:12 +0200 Subject: gladeui: fix memory leak in GWActionClass --- gladeui/glade-widget-action.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gladeui/glade-widget-action.c b/gladeui/glade-widget-action.c index 0484345c..8535bc61 100644 --- a/gladeui/glade-widget-action.c +++ b/gladeui/glade-widget-action.c @@ -342,13 +342,15 @@ void glade_widget_action_class_free (GWActionClass *action) { if (action->actions) - g_list_foreach (action->actions, (GFunc) glade_widget_action_class_free, - NULL); + { + g_list_free_full (action->actions, (GDestroyNotify) glade_widget_action_class_free); + action->actions = NULL; + } /* Dont free id since it points into path directly */ - g_free (action->path); - g_free (action->label); - g_free (action->stock); + g_clear_pointer (&action->path, g_free); + g_clear_pointer (&action->label, g_free); + g_clear_pointer (&action->stock, g_free); g_slice_free (GWActionClass, action); } -- cgit v1.2.1