From: Andrey Volk Date: Mon, 18 May 2020 22:48:02 +0000 (+0400) Subject: [Core] Fix multiple missing session unlocks in switch_core_media.c X-Git-Tag: v1.10.6^2~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09d4ec64338a32463577e8d7c48bf77cb0159418;p=thirdparty%2Ffreeswitch.git [Core] Fix multiple missing session unlocks in switch_core_media.c --- diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 0ae007ad90..d69e1286f5 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -6791,6 +6791,7 @@ static void *SWITCH_THREAD_FUNC video_write_thread(switch_thread_t *thread, void } if (!(smh = session->media_handle)) { + switch_core_session_rwunlock(session); return NULL; } @@ -7301,12 +7302,14 @@ static void *SWITCH_THREAD_FUNC text_helper_thread(switch_thread_t *thread, void return NULL; } - mh->ready = 1; - if (!(smh = session->media_handle)) { + switch_core_session_rwunlock(session); + mh->ready = -1; return NULL; } + mh->ready = 1; + channel = switch_core_session_get_channel(session); if (switch_channel_var_true(session->channel, "fire_text_events")) { @@ -7460,12 +7463,14 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi return NULL; } - mh->ready = 1; - if (!(smh = session->media_handle)) { + switch_core_session_rwunlock(session); + mh->ready = -1; return NULL; } + mh->ready = 1; + channel = switch_core_session_get_channel(session); switch_core_autobind_cpu();