mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
fix crash in sal with authenticated requests
This commit is contained in:
parent
165a0584fe
commit
8e19b64c69
2 changed files with 10 additions and 4 deletions
|
|
@ -246,6 +246,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
|
|||
{
|
||||
LinphoneAuthInfo *ai;
|
||||
MSList *elem;
|
||||
MSList *l;
|
||||
|
||||
/* find if we are attempting to modify an existing auth info */
|
||||
ai=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username);
|
||||
|
|
@ -255,7 +256,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
|
|||
}
|
||||
lc->auth_info=ms_list_append(lc->auth_info,linphone_auth_info_clone(info));
|
||||
/* retry pending authentication operations */
|
||||
for(elem=sal_get_pending_auths(lc->sal);elem!=NULL;elem=elem->next){
|
||||
for(l=elem=sal_get_pending_auths(lc->sal);elem!=NULL;elem=elem->next){
|
||||
const char *username,*realm;
|
||||
SalOp *op=(SalOp*)elem->data;
|
||||
LinphoneAuthInfo *ai;
|
||||
|
|
@ -271,6 +272,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
|
|||
ai->usecount++;
|
||||
}
|
||||
}
|
||||
ms_list_free(l);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1177,10 +1177,14 @@ static bool_t process_authentication(Sal *sal, eXosip_event_t *ev){
|
|||
return TRUE;
|
||||
}
|
||||
if (get_auth_data(ev,&realm,&username)==0){
|
||||
if (op->pending_auth!=NULL)
|
||||
if (op->pending_auth!=NULL){
|
||||
eXosip_event_free(op->pending_auth);
|
||||
op->pending_auth=ev;
|
||||
sal_add_pending_auth (sal,op);
|
||||
op->pending_auth=ev;
|
||||
}else{
|
||||
op->pending_auth=ev;
|
||||
sal_add_pending_auth(sal,op);
|
||||
}
|
||||
|
||||
sal->callbacks.auth_requested(op,realm,username);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue