From dc6cad468e2776c9d91c7d08d95481528533ebeb Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 23 Feb 2018 23:16:32 +0100 Subject: [PATCH] fix small memory leak. --- Classes/LinphoneAppDelegate.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index fc9fc78ab..0f99f8319 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -506,9 +506,11 @@ while (rooms) { const LinphoneAddress *room_from_address = linphone_chat_room_get_peer_address((LinphoneChatRoom *)rooms->data); char *room_from = linphone_address_as_string_uri_only(room_from_address); - if (room_from && strcmp(from, room_from) == 0) + if (room_from && strcmp(from, room_from) == 0){ + ms_free(room_from); return rooms->data; - + } + if (room_from) ms_free(room_from); rooms = rooms->next; } return NULL;