about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-11-13 00:47:07 +0000
committerJames Booth <boothj5@gmail.com>2014-11-13 00:47:07 +0000
commitada6f5a8b6c9e62728ff1f9a3580a11b11016625 (patch)
tree5e288469d516af65f0e5b35728f71a59fab2419b
parent20dc44c0a9c30839793234e7ce797976848c4e1b (diff)
downloadprofani-tty-ada6f5a8b6c9e62728ff1f9a3580a11b11016625.tar.gz
Fixed leaks
-rw-r--r--src/roster_list.c1
-rw-r--r--src/ui/core.c6
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);
     }
 }