FS-10118: [freeswitch-core] Race conditions from lack of error checking in switch_core_session_read_lock #resolve

This commit is contained in:
Anthony Minessale
2017-03-09 13:22:11 -06:00
parent abcb7f83a1
commit 35865bd90c
6 changed files with 76 additions and 23 deletions
+1 -2
View File
@@ -635,11 +635,10 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession(switch_core_session_t *new_s
{
init_vars();
if (new_session) {
if (new_session && switch_core_session_read_lock_hangup(new_session) == SWITCH_STATUS_SUCCESS) {
session = new_session;
channel = switch_core_session_get_channel(session);
allocated = 1;
switch_core_session_read_lock_hangup(session);
uuid = strdup(switch_core_session_get_uuid(session));
}
}