From: Adam Sutton Date: Mon, 7 Apr 2014 19:47:50 +0000 (+0100) Subject: timeshift: ensure no use of potentially free()'d variable (fixes #2028) X-Git-Tag: v4.1~2186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1369d5dbebb83e2bb9d5583325ef23fdd7aeb061;p=thirdparty%2Ftvheadend.git timeshift: ensure no use of potentially free()'d variable (fixes #2028) --- diff --git a/src/timeshift.c b/src/timeshift.c index 788bee6ee..216a4d972 100644 --- a/src/timeshift.c +++ b/src/timeshift.c @@ -175,7 +175,6 @@ static void timeshift_input /* Buffer to disk */ if ((ts->state > TS_LIVE) || (!ts->ondemand && (ts->state == TS_LIVE))) { sm->sm_time = getmonoclock(); - streaming_target_deliver2(&ts->wr_queue.sq_st, sm); if (sm->sm_type == SMT_PACKET) { tvhtrace("timeshift", "ts %d pkt buf - stream %d type %c pts %10"PRId64 @@ -188,6 +187,7 @@ static void timeshift_input pkt->pkt_duration, pktbuf_len(pkt->pkt_payload)); } + streaming_target_deliver2(&ts->wr_queue.sq_st, sm); } else streaming_msg_free(sm);