]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
timeshift: ensure no use of potentially free()'d variable (fixes #2028)
authorAdam Sutton <dev@adamsutton.me.uk>
Mon, 7 Apr 2014 19:47:50 +0000 (20:47 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 7 Apr 2014 19:47:50 +0000 (20:47 +0100)
src/timeshift.c

index 788bee6ee1c5926d7ff8b176475d89c7abf63f5f..216a4d9728aac8de493623f4ebc7fa478b4898ac 100644 (file)
@@ -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);