Fixed two tiny memory leaks in filtering pref dialog.
authorAndrej Kacian <ticho@claws-mail.org>
Sun, 16 Jul 2017 12:39:21 +0000 (14:39 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sun, 16 Jul 2017 12:39:21 +0000 (14:39 +0200)
src/prefs_filtering.c

index 7d969dad6049a81388fdb1e3f7d5739f07895394..2376cb1704a5ade45fba3447ba0a93fceda46b63 100644 (file)
@@ -960,6 +960,8 @@ static void prefs_filtering_set_list(void)
                        g_free(filtering_str);
                        if (prop) {
                                prop->enabled = enabled;
+                               if (prop->name != NULL)
+                                       g_free(prop->name);
                                prop->name = name;
                                prop->account_id = account_id;
                                prefs_filtering = 
@@ -1936,6 +1938,8 @@ static void prefs_filtering_select_row(GtkTreeView *list_view, GtkTreePath *path
 
                        prop = matcher_parser_get_filtering(filtering_str);
                        if (prop) {
+                               if (prop->name != NULL)
+                                       g_free(prop->name);
                                prop->name = g_strdup(name);
                                prop->account_id = account_id;
                                prefs_filtering_select_set(prop);