about summary refs log tree commit diff stats
path: root/src/ui/core.c
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 /src/ui/core.c
parent20dc44c0a9c30839793234e7ce797976848c4e1b (diff)
downloadprofani-tty-ada6f5a8b6c9e62728ff1f9a3580a11b11016625.tar.gz
Fixed leaks
Diffstat (limited to 'src/ui/core.c')
-rw-r--r--src/ui/core.c6
1 files changed, 4 insertions, 2 deletions
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);
     }
 }