From d28e18e0589c97807890eb01bf54a3f8eea20c73 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Tue, 26 Aug 2014 10:33:37 +0200 Subject: [PATCH] Null-check the auth-info when it fails. In some cases it could be Nil --- coreapi/callbacks.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 7a09fa76e..bbc4d57bf 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -827,15 +827,20 @@ static void call_released(SalOp *op){ static void auth_failure(SalOp *op, SalAuthInfo* info) { LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op)); - LinphoneAuthInfo *ai=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username,info->domain); - if (ai){ - ms_message("%s/%s/%s authentication fails.",info->realm,info->username,info->domain); - /*ask again for password if auth info was already supplied but apparently not working*/ - if (lc->vtable.auth_info_requested) { - lc->vtable.auth_info_requested(lc,info->realm,info->username,info->domain); + LinphoneAuthInfo *ai=NULL; + + if( info != NULL ){ + ai = (LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username,info->domain); + + if (ai){ + ms_message("%s/%s/%s authentication fails.",info->realm,info->username,info->domain); + /*ask again for password if auth info was already supplied but apparently not working*/ + if (lc->vtable.auth_info_requested) { + lc->vtable.auth_info_requested(lc,info->realm,info->username,info->domain); + } } } - + } static void register_success(SalOp *op, bool_t registered){