From 87e3530e222f18a36c032d5585029d4a43550ae9 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 14 Feb 2016 01:34:34 +0000 Subject: [PATCH 1/4] Added missing prefs_free_string() --- src/config/preferences.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config/preferences.c b/src/config/preferences.c index 96d97f39..32214c91 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -139,6 +139,7 @@ prefs_load(void) g_key_file_set_boolean(prefs, PREF_GROUP_NOTIFICATIONS, "room", FALSE); g_key_file_set_boolean(prefs, PREF_GROUP_NOTIFICATIONS, "room.mention", TRUE); } + prefs_free_string(value); } _save_prefs(); From 7a19ee822bc6268cc228305f950c2dcb0eed6776 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 14 Feb 2016 01:37:13 +0000 Subject: [PATCH 2/4] Fixed theme defaults memory release --- src/config/theme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/theme.c b/src/config/theme.c index d221bd3f..82d5a988 100644 --- a/src/config/theme.c +++ b/src/config/theme.c @@ -74,7 +74,7 @@ theme_init(const char *const theme_name) } str_to_pair = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); - defaults = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + defaults = g_hash_table_new_full(g_str_hash, g_str_equal, free, free); g_hash_table_insert(defaults, strdup("main.text"), strdup("white")); g_hash_table_insert(defaults, strdup("main.text.me"), strdup("white")); From d7b331874a1a98ad97ca9f331d4eab5d81b29b13 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 14 Feb 2016 01:49:57 +0000 Subject: [PATCH 3/4] Fix memory leaks --- src/event/server_events.c | 1 + src/window_list.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/event/server_events.c b/src/event/server_events.c index a21b27c0..5d0fda77 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -116,6 +116,7 @@ sv_ev_roster_received(void) } free(err_str); } + account_free(account); #endif // send initial presence diff --git a/src/window_list.c b/src/window_list.c index 7ba62e47..0dbaab85 100644 --- a/src/window_list.c +++ b/src/window_list.c @@ -628,6 +628,7 @@ wins_do_notify_remind(void) } curr = g_list_next(curr); } + g_list_free(values); return FALSE; } From f887a35c0cd550a3c635630da2bd83bb7400b957 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 14 Feb 2016 01:59:53 +0000 Subject: [PATCH 4/4] Fixed memory deallocations --- src/command/commands.c | 4 +++- src/ui/rosterwin.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/command/commands.c b/src/command/commands.c index 6a9972b6..ee2e9c83 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -154,7 +154,9 @@ cmd_execute_alias(ProfWin *window, const char *const inp, gboolean *ran) free(alias); if (value) { *ran = TRUE; - return cmd_process_input(window, value); + gboolean result = cmd_process_input(window, value); + prefs_free_string(value); + return result; } *ran = FALSE; diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index 964b006c..7e9009b1 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -759,6 +759,7 @@ _rosterwin_room(ProfLayoutSplit *layout, ProfMucWin *mucwin) } else { g_string_append(msg, mucwin->roomjid); } + prefs_free_string(roombypref); if ((g_strcmp0(unreadpos, "after") == 0) && mucwin->unread > 0) { g_string_append_printf(msg, " (%d)", mucwin->unread); }