Merge pull request #330 from dragos-oancea/sofia-sdp_val-never-read--

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

View File

@ -1244,6 +1244,8 @@ int sdp_connection_cmp(sdp_connection_t const *a, sdp_connection_t const *b)
if ((a != NULL) != (b != NULL))
return (a != NULL) < (b != NULL) ? -1 : 1;
if (!a || !b)
return -1;
if (a->c_nettype != b->c_nettype)
return a->c_nettype < b->c_nettype ? -1 : 1;
if (a->c_addrtype != b->c_addrtype)