From ada6f5a8b6c9e62728ff1f9a3580a11b11016625 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 13 Nov 2014 00:47:07 +0000 Subject: [PATCH] Fixed leaks --- src/roster_list.c | 1 + src/ui/core.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/roster_list.c b/src/roster_list.c index 0451d43f..771a1554 100644 --- a/src/roster_list.c +++ b/src/roster_list.c @@ -201,6 +201,7 @@ roster_remove(const char * const name, const char * const barejid) g_string_free(fulljid, TRUE); resources = g_list_next(resources); } + g_list_free(resources); } // remove the contact diff --git a/src/ui/core.c b/src/ui/core.c index a9b7b4c9..7fb0a01c 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -2932,7 +2932,8 @@ _ui_roster(void) { ProfWin *window = wins_get_console(); if (window) { - if (g_strcmp0(prefs_get_string(PREF_ROSTER_BY), "presence") == 0) { + char *by = prefs_get_string(PREF_ROSTER_BY); + if (g_strcmp0(by, "presence") == 0) { werase(window->subwin); _ui_roster_contacts_by_presence("chat", " -Available for chat"); _ui_roster_contacts_by_presence("online", " -Online"); @@ -2942,7 +2943,7 @@ _ui_roster(void) if (prefs_get_boolean(PREF_ROSTER_OFFLINE)) { _ui_roster_contacts_by_presence("offline", " -Offline"); } - } else if (g_strcmp0(prefs_get_string(PREF_ROSTER_BY), "group") == 0) { + } else if (g_strcmp0(by, "group") == 0) { werase(window->subwin); GSList *groups = roster_get_groups(); GSList *curr_group = groups; @@ -2967,6 +2968,7 @@ _ui_roster(void) } g_slist_free(contacts); } + free(by); } }