Fix crash during call invite if no SIP transport is available.

This commit is contained in:
Ghislain MARY 2017-01-12 17:48:18 +01:00
parent 17fd6667e0
commit 1f3b139551

View file

@ -2905,7 +2905,8 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, const Linph
barmsg=ortp_strdup_printf("%s %s", _("Contacting"), real_url);
linphone_core_notify_display_status(lc,barmsg);
ms_free(barmsg);
linphone_call_ref(call); /* Take a ref because sal_call() may destroy the call if no SIP transport is available */
err=sal_call(call->op,from,real_url);
if (err < 0){
@ -2928,6 +2929,7 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, const Linph
linphone_call_set_state(call,LinphoneCallOutgoingProgress,"Outgoing call in progress");
end:
linphone_call_unref(call); /* Revert the ref taken before calling sal_call() */
ms_free(real_url);
ms_free(from);
return err;