Commit ea5cc190 authored by Ghislain MARY's avatar Ghislain MARY

Fix some memory leaks.

parent e35b483f
......@@ -2187,9 +2187,9 @@ void MediaSessionPrivate::handleIceEvents (OrtpEvent *ev) {
if (iceAgent->hasCompletedCheckList()) {
/* At least one ICE session has succeeded, so perform a call update */
if (iceAgent->isControlling() && q->getCurrentParams()->getPrivate()->getUpdateCallWhenIceCompleted()) {
MediaSessionParams *newParams = new MediaSessionParams(*getParams());
newParams->getPrivate()->setInternalCallUpdate(true);
q->update(newParams);
MediaSessionParams newParams(*getParams());
newParams.getPrivate()->setInternalCallUpdate(true);
q->update(&newParams);
}
startDtlsOnAllStreams();
}
......
......@@ -775,10 +775,12 @@ bool_t check_ice(LinphoneCoreManager* caller, LinphoneCoreManager* callee, Linph
realtime_text_enabled=linphone_call_params_realtime_text_enabled(linphone_call_get_current_params(c1));
if (audio_enabled) {
liblinphone_tester_clock_start(&ts);
do{
LinphoneCallStats *stats1 = NULL;
LinphoneCallStats *stats2 = NULL;
do {
if ((c1 != NULL) && (c2 != NULL)) {
LinphoneCallStats *stats1 = linphone_call_get_audio_stats(c1);
LinphoneCallStats *stats2 = linphone_call_get_audio_stats(c2);
stats1 = linphone_call_get_audio_stats(c1);
stats2 = linphone_call_get_audio_stats(c2);
if (linphone_call_stats_get_ice_state(stats1)==state &&
linphone_call_stats_get_ice_state(stats2)==state){
audio_success=TRUE;
......@@ -786,13 +788,18 @@ bool_t check_ice(LinphoneCoreManager* caller, LinphoneCoreManager* callee, Linph
check_ice_from_rtp(c2,c1,LinphoneStreamTypeAudio);
break;
}
linphone_call_stats_unref(stats1);
linphone_call_stats_unref(stats2);
linphone_core_iterate(caller->lc);
linphone_core_iterate(callee->lc);
linphone_call_stats_unref(stats1);
linphone_call_stats_unref(stats2);
stats1 = stats2 = NULL;
}
ms_usleep(20000);
}while(!liblinphone_tester_clock_elapsed(&ts,10000));
} while (!liblinphone_tester_clock_elapsed(&ts,10000));
if (stats1)
linphone_call_stats_unref(stats1);
if (stats2)
linphone_call_stats_unref(stats2);
}
if (video_enabled){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment