From 86a075da5659ce6668241dc4bb12b3a339a47f71 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 26 Feb 2021 20:54:27 +0300 Subject: [PATCH] [mod_sofia] scan-build: Fix dereference of null pointer in sofia_outgoing_channel(). --- src/mod/endpoints/mod_sofia/mod_sofia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;