]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] scan-build: Fix dereference of null pointer in sofia_outgoing_channel().
authorAndrey Volk <andywolk@gmail.com>
Fri, 26 Feb 2021 17:54:27 +0000 (20:54 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 19 Oct 2021 17:26:53 +0000 (20:26 +0300)
src/mod/endpoints/mod_sofia/mod_sofia.c

index 79a3c06795a942e98912fa97992ae6eb69f9f496..4b6c463261a54689ce6c93aa1e270e8005f0d806 100644 (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;