From: Andrey Volk Date: Fri, 26 Feb 2021 17:54:27 +0000 (+0300) Subject: [mod_sofia] scan-build: Fix dereference of null pointer in sofia_outgoing_channel(). X-Git-Tag: v1.10.7^2~247 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86a075da5659ce6668241dc4bb12b3a339a47f71;p=thirdparty%2Ffreeswitch.git [mod_sofia] scan-build: Fix dereference of null pointer in sofia_outgoing_channel(). --- diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 79a3c06795..4b6c463261 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -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;