[mod_sofia] scan-build: Fix dereference of null pointer in sofia_outgoing_channel().

This commit is contained in:
Andrey Volk 2021-02-26 20:54:27 +03:00
parent 51ef2f261a
commit 86a075da56
1 changed files with 1 additions and 1 deletions

View File

@ -4797,7 +4797,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
*dest++ = '\0';
if (!(gateway_ptr = sofia_reg_find_gateway(gw))) {
if (!(gateway_ptr = sofia_reg_find_gateway(gw)) || !gateway_ptr->profile) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Gateway \'%s\'\n", gw);
cause = SWITCH_CAUSE_INVALID_GATEWAY;
goto error;