From: Yann Diorcet Date: Mon, 18 Feb 2013 14:00:19 +0000 (+0100) Subject: Fix memory leak on linphone core unfree variables X-Git-Url: http://sjero.net/git/?p=linphone;a=commitdiff_plain;h=e546e97a353d6fc2b40f994514bc15ecae34bab5 Fix memory leak on linphone core unfree variables --- diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 608d1c6e..8068964c 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -5176,7 +5176,6 @@ static void linphone_core_uninit(LinphoneCore *lc) usleep(50000); #endif } - #ifdef BUILD_UPNP if(lc->upnp != NULL) { linphone_upnp_context_destroy(lc->upnp); @@ -5214,6 +5213,17 @@ static void linphone_core_uninit(LinphoneCore *lc) ms_list_for_each(lc->last_recv_msg_ids,ms_free); lc->last_recv_msg_ids=ms_list_free(lc->last_recv_msg_ids); + + // Free struct variable + if(lc->zrtp_secrets_cache != NULL) { + ms_free(lc->zrtp_secrets_cache); + } + if(lc->play_file!=NULL){ + ms_free(lc->play_file); + } + if(lc->rec_file!=NULL){ + ms_free(lc->rec_file); + } linphone_core_free_payload_types(lc); ortp_exit();