about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-07-22 15:37:41 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-07-22 15:37:41 +0200
commit9f0a40819fe76eab9d82a16c6d998baf528e43b4 (patch)
tree79752d162fcc26bc5c54e4b7f7a1a867c123eb4c /src
parent41b54a5c143a6ff6b0b6cdec5b7a10af831c16d2 (diff)
downloadprofani-tty-9f0a40819fe76eab9d82a16c6d998baf528e43b4.tar.gz
Fix memleak in roster_change_name()
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/roster_list.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xmpp/roster_list.c b/src/xmpp/roster_list.c
index 4c4f4108..dee7e362 100644
--- a/src/xmpp/roster_list.c
+++ b/src/xmpp/roster_list.c
@@ -232,10 +232,9 @@ void
 roster_change_name(PContact contact, const char *const new_name)
 {
     assert(roster != NULL);
-
     assert(contact != NULL);
 
-    const char *current_name = NULL;
+    char *current_name = NULL;
     const char *barejid = p_contact_barejid(contact);
 
     if (p_contact_name(contact)) {
@@ -244,6 +243,7 @@ roster_change_name(PContact contact, const char *const new_name)
 
     p_contact_set_name(contact, new_name);
     _replace_name(current_name, new_name, barejid);
+    free(current_name);
 }
 
 void