From 9f0a40819fe76eab9d82a16c6d998baf528e43b4 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 22 Jul 2019 15:37:41 +0200 Subject: Fix memleak in roster_change_name() --- src/xmpp/roster_list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit 1.4.1-2-gfad0