]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
fix more memory leaks (many thanks to valgrind)
authorAndreas Öman <andreas@lonelycoder.com>
Sat, 9 Feb 2008 16:25:36 +0000 (16:25 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sat, 9 Feb 2008 16:25:36 +0000 (16:25 +0000)
channels.c
transports.c
tsmux.c

index d59018d689569acbadc88c520a8b93c4f6754cec..88a559ce9b5ad5325c001f551debde4cbdd28934 100644 (file)
@@ -297,17 +297,15 @@ channels_load(void)
     TAILQ_INIT(&cl);
     config_read_file0(buf, &cl);
 
-    if((name = config_get_str_sub(&cl, "name", NULL)) == NULL)
-      continue;
-
-    if((grp = config_get_str_sub(&cl, "channel-group", NULL)) == NULL)
-      continue;
-
-    tcg = channel_group_find(grp, 1);
-    ch = channel_find(name, 1, tcg);
+    name = config_get_str_sub(&cl, "name", NULL);
+    grp = config_get_str_sub(&cl, "channel-group", NULL);
+    if(name != NULL && grp != NULL) {
+      tcg = channel_group_find(grp, 1);
+      ch = channel_find(name, 1, tcg);
       
-    ch->ch_teletext_rundown = 
-      atoi(config_get_str_sub(&cl, "teletext-rundown", "0"));
+      ch->ch_teletext_rundown = 
+       atoi(config_get_str_sub(&cl, "teletext-rundown", "0"));
+    }
 
     config_free0(&cl);
   }
index 0a94c262d28d66273e3aca69c7466f0babeaf9a9..09b06c6f5abeb0a5e5603fccad7920c1b71db99c 100644 (file)
@@ -95,6 +95,8 @@ transport_stop(th_transport_t *t, int flush_subscriptions)
     if(st->st_ctx != NULL)
       avcodec_close(st->st_ctx);
 
+    av_free(st->st_ctx);
+
     st->st_parser = NULL;
     st->st_ctx = NULL;
 
diff --git a/tsmux.c b/tsmux.c
index 59543f854a53bd1dac4dbb412d150db8dba0f51e..1ef3626b6a7ed9195d6d9d71bd3cbd4e4e1a6460 100644 (file)
--- a/tsmux.c
+++ b/tsmux.c
@@ -714,6 +714,7 @@ ts_muxer_deinit(ts_muxer_t *ts, th_subscription_t *s)
     while((o = TAILQ_FIRST(&tms->tms_lookahead)) != NULL) {
       pkt_deref(o->trp_pkt);
       TAILQ_REMOVE(&tms->tms_lookahead, o, trp_link);
+      free(o);
     }
   }