From 9f00c5cd766cef40701cf57560ec372a8a0ad71b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 29 Mar 2016 11:11:16 +0200 Subject: [PATCH] Fixes memory leaks in linphone_call_make_local_media_description() --- coreapi/linphonecall.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 39089fdbe..5e5e78bcd 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -751,6 +751,7 @@ void linphone_call_make_local_media_description(LinphoneCall *call) { } else { ms_message("Don't put audio stream on local offer for call [%p]",call); md->streams[call->main_audio_stream_index].dir = SalStreamInactive; + if(l) l=ms_list_free_with_data(l, (void (*)(void *))payload_type_destroy); } if (params->custom_sdp_media_attributes[LinphoneStreamTypeAudio]) md->streams[call->main_audio_stream_index].custom_sdp_attributes = sal_custom_sdp_attribute_clone(params->custom_sdp_media_attributes[LinphoneStreamTypeAudio]); @@ -785,6 +786,7 @@ void linphone_call_make_local_media_description(LinphoneCall *call) { } else { ms_message("Don't put video stream on local offer for call [%p]",call); md->streams[call->main_video_stream_index].dir = SalStreamInactive; + if(l) l=ms_list_free_with_data(l, (void (*)(void *))payload_type_destroy); } if (params->custom_sdp_media_attributes[LinphoneStreamTypeVideo]) md->streams[call->main_video_stream_index].custom_sdp_attributes = sal_custom_sdp_attribute_clone(params->custom_sdp_media_attributes[LinphoneStreamTypeVideo]);