Merge pull request #299 from dragos-oancea/mod_sofia-nullptr

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

View File

@ -10097,7 +10097,7 @@ void sofia_handle_sip_i_reinvite(switch_core_session_t *session,
}
tech_pvt->mparams.last_sdp_str = NULL;
if (sip->sip_payload && sip->sip_payload->pl_data) {
if (sip && sip->sip_payload && sip->sip_payload->pl_data) {
if (!zstr(tech_pvt->mparams.prev_sdp_str) && strcmp(tech_pvt->mparams.prev_sdp_str, sip->sip_payload->pl_data)) {
switch_channel_set_variable(channel, "sip_reinvite_sdp", sip->sip_payload->pl_data);
tech_pvt->mparams.last_sdp_str = switch_core_session_strdup(session, sip->sip_payload->pl_data);