about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-07-27 22:07:11 +0100
committerJames Booth <boothj5@gmail.com>2016-07-27 22:07:11 +0100
commita1f48f8457436fe6d331469e40cff20a74c3b13b (patch)
treeb70a46075a4c5373f0034ef326c0bdc00ebd4f34
parent6c1fef522a6bd74033ddf8497e9cd305026b0a56 (diff)
downloadprofani-tty-a1f48f8457436fe6d331469e40cff20a74c3b13b.tar.gz
Copy curr_status and free original in session.c
-rw-r--r--src/xmpp/session.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/xmpp/session.c b/src/xmpp/session.c
index 139d2fdb..0478fec3 100644
--- a/src/xmpp/session.c
+++ b/src/xmpp/session.c
@@ -397,7 +397,7 @@ session_check_autoaway(void)
                     if (saved_status) {
                         free(saved_status);
                     }
-                    saved_status = curr_status;
+                    saved_status = strdup(curr_status);
 
                     // send away presence with last activity
                     char *message = prefs_get_string(PREF_AUTOAWAY_MESSAGE);
@@ -481,6 +481,7 @@ session_check_autoaway(void)
         break;
     }
 
+    free(curr_status);
     prefs_free_string(mode);
 }