Skip to content

Commit

Permalink
Fixed a couple of additional early deallocations of VideoRoom messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Nov 24, 2021
1 parent 259ec96 commit 46571c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/janus_videoroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -8087,7 +8087,6 @@ static void *janus_videoroom_handler(void *data) {
JANUS_LOG(LOG_VERB, " >> Pushing event: %d (took %"SCNu64" us)\n", res, janus_get_monotonic_time()-start);
json_decref(event);
json_decref(jsep);
janus_videoroom_message_free(msg);
/* Also notify event handlers */
if(notify_events && gateway->events_is_enabled()) {
json_t *info = json_object();
Expand All @@ -8106,6 +8105,7 @@ static void *janus_videoroom_handler(void *data) {
janus_refcount_decrease(&publisher->ref);
publishers = g_list_remove(publishers, publisher);
}
janus_videoroom_message_free(msg);
continue;
} else {
janus_mutex_unlock(&videoroom->mutex);
Expand Down Expand Up @@ -8740,15 +8740,15 @@ static void *janus_videoroom_handler(void *data) {
int res = gateway->push_event(msg->handle, &janus_videoroom_plugin, msg->transaction, event, NULL);
JANUS_LOG(LOG_VERB, " >> Pushing event: %d (took %"SCNu64" us)\n", res, janus_get_monotonic_time()-start);
json_decref(event);
/* Done */
janus_videoroom_message_free(msg);
/* Decrease the references we took before */
while(publishers) {
janus_videoroom_publisher *publisher = (janus_videoroom_publisher *)publishers->data;
janus_refcount_decrease(&publisher->session->ref);
janus_refcount_decrease(&publisher->ref);
publishers = g_list_remove(publishers, publisher);
}
/* Done */
janus_videoroom_message_free(msg);
continue;
}
if(!g_atomic_int_get(&subscriber->answered)) {
Expand Down

0 comments on commit 46571c4

Please sign in to comment.