From 76c5c97cc69e99fd801ce294afdc159ddb41b1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Thu, 17 May 2018 15:14:41 +0200 Subject: [PATCH] Fix crash when call is NULL --- coreapi/linphonecore.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index fbf781ee3..abc4325df 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3791,11 +3791,7 @@ static LinphoneCall * get_unique_call(LinphoneCore *lc) { return call; } -LinphoneStatus linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call) { - return linphone_call_accept_with_params(call, NULL); -} - -LinphoneStatus linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params) { +static LinphoneStatus _linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params) { if (call == NULL) { call = get_unique_call(lc); if (call == NULL) { @@ -3806,6 +3802,14 @@ LinphoneStatus linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneC return linphone_call_accept_with_params(call, params); } +LinphoneStatus linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call) { + return _linphone_core_accept_call_with_params(lc, call, NULL); +} + +LinphoneStatus linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params) { + return _linphone_core_accept_call_with_params(lc, call, params); +} + LinphoneStatus linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri) { return linphone_call_redirect(call, redirect_uri); }