Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: Fix the wrong memory access
Note that dvr_thread() uses the de->de_s contents which is
freed in subscription_unsubscribe().

Move the subscription_unsubscribe() as last.
  • Loading branch information
perexg committed Sep 17, 2014
1 parent 2e017d6 commit a766245
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dvr/dvr_rec.c
Expand Up @@ -104,11 +104,11 @@ dvr_rec_unsubscribe(dvr_entry_t *de, int stopcode)
{
assert(de->de_s != NULL);

subscription_unsubscribe(de->de_s);

streaming_target_deliver(&de->de_sq.sq_st, streaming_msg_create(SMT_EXIT));

pthread_join(de->de_thread, NULL);

subscription_unsubscribe(de->de_s);
de->de_s = NULL;

if(de->de_tsfix)
Expand Down

0 comments on commit a766245

Please sign in to comment.