From 5283278eef6dcae0fbde285999cf1fcd29de3547 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 9 Sep 2014 10:29:32 +0200 Subject: [PATCH] Fix 2 memory leaks. --- coreapi/linphonecall.c | 1 + coreapi/linphonecore.c | 1 + 2 files changed, 2 insertions(+) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 47d5ca347..578313794 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -658,6 +658,7 @@ static void linphone_call_get_local_ip(LinphoneCall *call, const LinphoneAddress if (err == 0) { dest = domain; } + if (res != NULL) freeaddrinfo(res); } if (linphone_core_get_firewall_policy(call->core)==LinphonePolicyUseNatAddress && (ip=linphone_core_get_nat_address_resolved(call->core))!=NULL){ diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index e43135e3d..84b64621c 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3528,6 +3528,7 @@ static int remote_address_compare(LinphoneCall *call, const LinphoneAddress *rad LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, const char *remote_address){ LinphoneAddress *raddr=linphone_address_new(remote_address); MSList *elem=ms_list_find_custom(lc->calls,(int (*)(const void*,const void *))remote_address_compare,raddr); + linphone_address_unref(raddr); if (elem) return (LinphoneCall*) elem->data; return NULL; }