]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Fix possible deadlock of an rtp_session in handle_ice()
authorAndrey Volk <andywolk@gmail.com>
Wed, 14 Jul 2021 20:05:59 +0000 (23:05 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:51 +0000 (22:00 +0300)
src/switch_rtp.c

index f2c5bf7405f3c8c17dcaed615c6a4ae28f713a4c..36bd904e77318494da2c5eea2ad952f59163fa49 100644 (file)
@@ -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)) {