From 355adb117cf1e66eca95a162bb1986b4fd049043 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 7 Mar 2016 18:24:04 +0000 Subject: Added WIN_PLUGIN case to win_free() --- src/ui/window.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/ui/window.c b/src/ui/window.c index 05eaf586..f52ebc41 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -419,27 +419,42 @@ win_free(ProfWin* window) } free(window->layout); - if (window->type == WIN_CHAT) { + switch (window->type) { + case WIN_CHAT: + { ProfChatWin *chatwin = (ProfChatWin*)window; free(chatwin->barejid); free(chatwin->resource_override); chat_state_free(chatwin->state); + break; } - - if (window->type == WIN_MUC) { + case WIN_MUC: + { ProfMucWin *mucwin = (ProfMucWin*)window; free(mucwin->roomjid); + break; } - - if (window->type == WIN_MUC_CONFIG) { + case WIN_MUC_CONFIG: + { ProfMucConfWin *mucconf = (ProfMucConfWin*)window; free(mucconf->roomjid); form_destroy(mucconf->form); + break; } - - if (window->type == WIN_PRIVATE) { + case WIN_PRIVATE: + { ProfPrivateWin *privatewin = (ProfPrivateWin*)window; free(privatewin->fulljid); + break; + } + case WIN_PLUGIN: + { + ProfPluginWin *pluginwin = (ProfPluginWin*)window; + free(pluginwin->tag); + break; + } + default: + break; } free(window); -- cgit 1.4.1-2-gfad0 From 958dc6b18454774f13f2a4976a06f5800154039d Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 7 Mar 2016 18:30:13 +0000 Subject: Free GList in wins_get_plugin --- src/window_list.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window_list.c b/src/window_list.c index 5fab7ba0..9e4ede98 100644 --- a/src/window_list.c +++ b/src/window_list.c @@ -212,6 +212,7 @@ wins_get_plugin(const char *const tag) if (window->type == WIN_PLUGIN) { ProfPluginWin *pluginwin = (ProfPluginWin*)window; if (g_strcmp0(pluginwin->tag, tag) == 0) { + g_list_free(values); return pluginwin; } } -- cgit 1.4.1-2-gfad0 From 72f940360dbb483177475f4dc97dae8227243619 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 7 Mar 2016 18:32:32 +0000 Subject: Free GLists in plugin autocompleters --- src/plugins/autocompleters.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/autocompleters.c b/src/plugins/autocompleters.c index 631987b1..483af7ca 100644 --- a/src/plugins/autocompleters.c +++ b/src/plugins/autocompleters.c @@ -67,10 +67,12 @@ autocompleters_complete(const char * const input) while (curr) { result = autocomplete_param_with_ac(input, curr->data, g_hash_table_lookup(autocompleters, curr->data), TRUE); if (result) { + g_list_free(keys); return result; } curr = g_list_next(curr); } + g_list_free(keys); return NULL; } @@ -84,6 +86,8 @@ autocompleters_reset(void) autocomplete_reset(curr->data); curr = g_list_next(curr); } + + g_list_free(acs); } void autocompleters_destroy(void) -- cgit 1.4.1-2-gfad0 From 4094b75ccc19780e2e013ba897a09645a5ee4978 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 7 Mar 2016 18:39:24 +0000 Subject: Fixed valgrind libotr suppressions --- prof.supp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/prof.supp b/prof.supp index e456551b..4f182054 100644 --- a/prof.supp +++ b/prof.supp @@ -12,9 +12,7 @@ otrl_init Memcheck:Leak ... - fun:_otr_init - fun:_init - fun:prof_run + fun:otrl_init ... } -- cgit 1.4.1-2-gfad0 4dcf9049e'>^
1
2
3
4
5
6
7
8
9