If the rsession is null, then don't try to unlock it, since that'll just result in a segfault.

This commit is contained in:
William King 2013-04-23 10:22:49 -07:00
parent 985c8de056
commit 198ae2fa05
1 changed files with 4 additions and 2 deletions

View File

@ -462,7 +462,7 @@ switch_status_t rtmp_write_frame(switch_core_session_t *session, switch_frame_t
rsession = tech_pvt->rtmp_session; rsession = tech_pvt->rtmp_session;
if ( rsession == NULL ) { if ( rsession == NULL ) {
goto error; goto error_null;
} }
switch_thread_rwlock_wrlock(rsession->rwlock); switch_thread_rwlock_wrlock(rsession->rwlock);
@ -514,6 +514,8 @@ switch_status_t rtmp_write_frame(switch_core_session_t *session, switch_frame_t
error: error:
switch_thread_rwlock_unlock(rsession->rwlock); switch_thread_rwlock_unlock(rsession->rwlock);
error_null:
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }