From a766245f8af413914ba8f9c298270b9e548f1966 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 17 Sep 2014 11:43:51 +0200 Subject: [PATCH] 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. --- src/dvr/dvr_rec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dvr/dvr_rec.c b/src/dvr/dvr_rec.c index 9ba65fbf..59f05b65 100644 --- a/src/dvr/dvr_rec.c +++ b/src/dvr/dvr_rec.c @@ -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)