Skip to content

Commit

Permalink
Fixed crash in VideoRoom plugin when failing to setup subscriber (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Jul 16, 2020
1 parent 8526226 commit f1f5964
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/janus_videoroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -6107,8 +6107,7 @@ static void *janus_videoroom_handler(void *data) {
if((!publisher->audio || !subscriber->audio_offered) &&
(!publisher->video || !subscriber->video_offered) &&
(!publisher->data || !subscriber->data_offered)) {
g_free(subscriber);
if (owner) {
if(owner) {
janus_refcount_decrease(&owner->session->ref);
janus_refcount_decrease(&owner->ref);
}
Expand All @@ -6119,6 +6118,7 @@ static void *janus_videoroom_handler(void *data) {
g_snprintf(error_cause, 512, "Can't offer an SDP with no audio, video or data");
janus_mutex_unlock(&sessions_mutex);
janus_refcount_decrease(&subscriber->room->ref);
g_free(subscriber);
goto error;
}
subscriber->audio = audio ? json_is_true(audio) : TRUE; /* True by default */
Expand Down

0 comments on commit f1f5964

Please sign in to comment.