Check the return status of pj_getaddrinfo() when creating contact (#3601)

This commit is contained in:
sauwming 2023-06-27 14:07:04 +08:00 committed by GitHub
parent c600708a3b
commit db78bc0c46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -3586,7 +3586,9 @@ pj_status_t pjsua_acc_get_uac_addr(pjsua_acc_id acc_id,
}
ai_cnt = 1;
pj_getaddrinfo(af, &dinfo.addr.host, &ai_cnt, &ai[0]);
status = pj_getaddrinfo(af, &dinfo.addr.host, &ai_cnt, &ai[0]);
if (status != PJ_SUCCESS)
ai_cnt = 0;
/* Get fallback address, only if the host is not IP address and
* account is not bound to a certain transport.
@ -3607,7 +3609,9 @@ pj_status_t pjsua_acc_get_uac_addr(pjsua_acc_id acc_id,
(af == pj_AF_INET6() &&
acc->cfg.ipv6_sip_use != PJSUA_IPV6_DISABLED))
{
pj_getaddrinfo(af, &dinfo.addr.host, &cnt, &ai[ai_cnt]);
status = pj_getaddrinfo(af, &dinfo.addr.host, &cnt, &ai[ai_cnt]);
if (status != PJ_SUCCESS)
cnt = 0;
ai_cnt += cnt;
}
}