Merge pull request #332 from dragos-oancea/sofia-tport-null-ptr

[sofia-sip] scan-build: Access to field 'ai_addr' results in a dereference of a null pointer (loaded from variable 'res')
This commit is contained in:
Andrey Volk 2020-02-12 22:42:46 +04:00 committed by GitHub
commit 801cb5813f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1661,6 +1661,8 @@ int tport_bind_server(tport_master_t *mr,
for (tbf = &mr->mr_primaries; *tbf; tbf = &(*tbf)->pri_next)
;
if (!res)
return -1;
port = port0 = port1 = ntohs(((su_sockaddr_t *)res->ai_addr)->su_port);
error = EPROTONOSUPPORT;