Skip to content

Commit

Permalink
rtp_relay: remove context from the list on repicated deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Sep 12, 2023
1 parent 1d4d5a6 commit 1af376b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/rtp_relay/rtp_relay_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ static void rtp_relay_ctx_free(struct rtp_relay_ctx *ctx)
list_for_each_safe(it, safe, &ctx->sessions)
rtp_relay_ctx_free_sess(list_entry(it, struct rtp_relay_sess, list));

lock_start_write(rtp_relay_contexts_lock);
if (list_is_valid(&ctx->list))
list_del(&ctx->list);
lock_stop_write(rtp_relay_contexts_lock);

lock_destroy(&ctx->lock);
shm_free(ctx);
}
Expand Down

0 comments on commit 1af376b

Please sign in to comment.