Commit 028afb26 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

linphonecore.c: release adress after usage

parent f14b6e73
...@@ -3854,22 +3854,21 @@ static void terminate_call(LinphoneCore *lc, LinphoneCall *call){ ...@@ -3854,22 +3854,21 @@ static void terminate_call(LinphoneCore *lc, LinphoneCall *call){
} }
int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri){ int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri){
char *real_url=NULL;
LinphoneAddress *real_parsed_url=linphone_core_interpret_url(lc,redirect_uri);
if (!real_parsed_url){
/* bad url */
ms_error("Bad redirect URI: %s", redirect_uri?:"NULL");
return -1;
}
if (call->state==LinphoneCallIncomingReceived){ if (call->state==LinphoneCallIncomingReceived){
char *real_url=NULL;
LinphoneAddress *real_parsed_url=linphone_core_interpret_url(lc,redirect_uri);
if (!real_parsed_url){
/* bad url */
ms_error("Bad redirect URI: %s", redirect_uri?:"NULL");
return -1;
}
real_url=linphone_address_as_string (real_parsed_url); real_url=linphone_address_as_string (real_parsed_url);
sal_call_decline(call->op,SalReasonRedirect,real_url); sal_call_decline(call->op,SalReasonRedirect,real_url);
ms_free(real_url); ms_free(real_url);
sal_error_info_set(&call->non_op_error,SalReasonRedirect,603,"Call redirected",NULL); sal_error_info_set(&call->non_op_error,SalReasonRedirect,603,"Call redirected",NULL);
terminate_call(lc,call); terminate_call(lc,call);
linphone_address_unref(real_parsed_url);
}else{ }else{
ms_error("Bad state for call redirection."); ms_error("Bad state for call redirection.");
return -1; return -1;
......
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