]> sjero.net Git - linphone/commitdiff
Fix memory leak on linphone core unfree variables
authorYann Diorcet <yann.diorcet@belledonne-communications.com>
Mon, 18 Feb 2013 14:00:19 +0000 (15:00 +0100)
committerYann Diorcet <yann.diorcet@belledonne-communications.com>
Mon, 18 Feb 2013 14:00:19 +0000 (15:00 +0100)
coreapi/linphonecore.c

index 608d1c6e55f2541c00181c6fcd1abe0f8dff159f..8068964c0a2f81606597d3cbabb9d7761432ba3a 100644 (file)
@@ -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();