]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Plug two memory leaks
authorAndreas Öman <andreas@lonelycoder.com>
Tue, 15 Jun 2010 17:43:41 +0000 (17:43 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Tue, 15 Jun 2010 17:43:41 +0000 (17:43 +0000)
src/dvr/dvr_rec.c
src/plumbing/tsfix.c

index 6faaca25c23ec29e39a711232f865628db3843da..1362e08ffa468e25345235874f85c36ce230cde0 100644 (file)
@@ -472,6 +472,7 @@ dvr_thread(void *aux)
     switch(sm->sm_type) {
     case SMT_PACKET:
       pkt = sm->sm_data;
+      sm->sm_data = NULL;
       if(dispatch_clock > de->de_start - (60 * de->de_start_extra)) {
        pkt = pkt_merge_global(pkt);
        dvr_thread_new_pkt(de, pkt);
@@ -559,7 +560,7 @@ dvr_thread(void *aux)
       break;
     }
 
-    free(sm);
+    streaming_msg_free(sm);
     pthread_mutex_lock(&sq->sq_mutex);
   }
   pthread_mutex_unlock(&sq->sq_mutex);
index b9797cbfe8c1cc5bee99c6f5d69275d5979d3ff2..30df73ba81bb855cd8d6e6da6a1f3e21ccefd868 100644 (file)
@@ -209,6 +209,7 @@ normalize_ts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt)
 
   streaming_message_t *sm = streaming_msg_create_pkt(pkt);
   streaming_target_deliver2(tf->tf_output, sm);
+  pkt_ref_dec(pkt);
 }