From a065460e5f4c7407729d712d934b868f37c350ed Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 14 Jul 2021 23:05:59 +0300 Subject: [PATCH] [Core] Fix possible deadlock of an rtp_session in handle_ice() --- src/switch_rtp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index f2c5bf7405..36bd904e77 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1151,8 +1151,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d if (!host || !port) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error setting remote host!\n"); - switch_mutex_unlock(rtp_session->ice_mutex); - return; + goto end; } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, @@ -1176,8 +1175,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d if (switch_sockaddr_info_get(&ice->addr, host, SWITCH_UNSPEC, port, 0, rtp_session->pool) != SWITCH_STATUS_SUCCESS || !ice->addr) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error setting remote host!\n"); - switch_mutex_unlock(rtp_session->ice_mutex); - return; + goto end; } if ((rtp_session->rtp_bugs & RTP_BUG_ALWAYS_AUTO_ADJUST)) {