Commit ca568440 authored by Simon Morlat's avatar Simon Morlat

fix memory leaks

parent 1eba5665
......@@ -2639,6 +2639,7 @@ static void call_established_with_complex_rejected_operation(void) {
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
bool_t call_ok=FALSE;
LinphoneCallParams *params;
LinphoneInfoMessage *info;
BC_ASSERT_TRUE((call_ok=call(pauline,marie)));
if (call_ok){
......@@ -2652,7 +2653,9 @@ static void call_established_with_complex_rejected_operation(void) {
linphone_core_enable_payload_type(marie->lc,linphone_core_find_payload_type(marie->lc,"PCMA",8000,1),TRUE); /*enable PCMA*/
/*just to authenticate marie*/
linphone_call_send_info_message(linphone_core_get_current_call(marie->lc),linphone_core_create_info_message(marie->lc));
info = linphone_core_create_info_message(marie->lc);
linphone_call_send_info_message(linphone_core_get_current_call(marie->lc), info);
linphone_info_message_unref(info);
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_inforeceived,1));
BC_ASSERT_EQUAL(pauline->stat.number_of_inforeceived,1, int, "%d");
/*to give time for 200ok to arrive*/
......@@ -2672,8 +2675,9 @@ static void call_established_with_complex_rejected_operation(void) {
check_call_state(marie,LinphoneCallStreamsRunning);
linphone_call_update(linphone_core_get_current_call(pauline->lc),linphone_call_get_current_params(linphone_core_get_current_call(pauline->lc)));
linphone_call_send_info_message(linphone_core_get_current_call(marie->lc),linphone_core_create_info_message(marie->lc));
info = linphone_core_create_info_message(marie->lc);
linphone_call_send_info_message(linphone_core_get_current_call(marie->lc), info);
linphone_info_message_unref(info);
params=linphone_core_create_call_params(marie->lc,linphone_core_get_current_call(marie->lc));
sal_enable_pending_trans_checking(marie->lc->sal,FALSE); /*to allow // transactions*/
......@@ -2704,7 +2708,7 @@ static void call_established_with_rejected_info_during_reinvite(void) {
BC_ASSERT_TRUE((call_ok=call(pauline,marie)));
if (call_ok){
LinphoneInfoMessage *info;
BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallStreamsRunning,1));
BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallStreamsRunning,1));
......@@ -2714,15 +2718,18 @@ static void call_established_with_rejected_info_during_reinvite(void) {
linphone_core_enable_payload_type(marie->lc,linphone_core_find_payload_type(marie->lc,"PCMA",8000,1),TRUE); /*enable PCMA*/
/*just to authenticate marie*/
linphone_call_send_info_message(linphone_core_get_current_call(marie->lc),linphone_core_create_info_message(marie->lc));
info = linphone_core_create_info_message(marie->lc);
linphone_call_send_info_message(linphone_core_get_current_call(marie->lc), info);
linphone_info_message_unref(info);
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_inforeceived,1));
BC_ASSERT_EQUAL(pauline->stat.number_of_inforeceived,1, int, "%d");
/*to give time for 200ok to arrive*/
wait_for_until(marie->lc,pauline->lc,NULL,0,1000);
//sal_enable_pending_trans_checking(marie->lc->sal,FALSE); /*to allow // transactions*/
linphone_call_send_info_message(linphone_core_get_current_call(marie->lc),linphone_core_create_info_message(marie->lc));
info = linphone_core_create_info_message(marie->lc);
linphone_call_send_info_message(linphone_core_get_current_call(marie->lc),info);
linphone_info_message_unref(info);
//sal_set_send_error(marie->lc->sal, -1); /*to avoid 491 pending to be sent*/
......@@ -2862,6 +2869,7 @@ static void call_established_with_rejected_reinvite_with_error_base(bool_t trans
if (trans_pending) {
LinphoneInfoMessage * info = linphone_core_create_info_message(pauline->lc);
linphone_call_send_info_message(linphone_core_get_current_call(pauline->lc),info);
linphone_info_message_unref(info);
} else
sal_enable_unconditional_answer(marie->lc->sal,TRUE);
......
......@@ -1441,6 +1441,7 @@ static void multiple_early_media(void) {
/*send an INFO in reverse side to check that dialogs are properly established*/
info=linphone_core_create_info_message(marie1->lc);
linphone_call_send_info_message(marie1_call,info);
linphone_info_message_unref(info);
BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_inforeceived,1,3000));
}
......
......@@ -503,6 +503,7 @@ static void forked_outgoing_early_media_video_call_with_inactive_audio_test(void
/* send an INFO in reverse side to check that dialogs are properly established */
info = linphone_core_create_info_message(marie1->lc);
linphone_call_send_info_message(marie1_call, info);
linphone_info_message_unref(info);
BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_inforeceived, 1, 3000));
}
......
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