]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Plug some memory leaks
authorAndreas Öman <andreas@lonelycoder.com>
Thu, 25 Oct 2012 09:51:03 +0000 (11:51 +0200)
committerAndreas Öman <andreas@lonelycoder.com>
Thu, 25 Oct 2012 11:06:55 +0000 (13:06 +0200)
src/epg.c
src/epggrab/otamux.c
src/main.c

index 58009eb84c2349141e8e7c98bbd890f06bf6ee5e..3a658b2738b98a390b095c8ee0c013c34e26af17 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -990,6 +990,7 @@ int epg_episode_set_genre
     g2 = LIST_NEXT(g1, link);
     if (!epg_genre_list_contains(genre, g1, 0)) {
       LIST_REMOVE(g1, link);
+      free(g1);
       save = 1;
     }
     g1 = g2;
@@ -1839,10 +1840,15 @@ epg_broadcast_t *epg_broadcast_deserialize
   if (!htsmsg_get_u32(m, "is_repeat", &u32))
     *save |= epg_broadcast_set_is_repeat(ebc, u32, NULL);
 
-  if ((ls = lang_str_deserialize(m, "summary")))
+  if ((ls = lang_str_deserialize(m, "summary"))) {
     *save |= epg_broadcast_set_summary2(ebc, ls, NULL);
-  if ((ls = lang_str_deserialize(m, "description")))
+    lang_str_destroy(ls);
+  }
+
+  if ((ls = lang_str_deserialize(m, "description"))) {
     *save |= epg_broadcast_set_description2(ebc, ls, NULL);
+    lang_str_destroy(ls);
+  }
 
   /* Series link */
   if ((str = htsmsg_get_str(m, "serieslink")))
index 80ace9d27fe3191dfccf08ef5e6068058cf3b6ba..c424207975f4f82867d5f32fb7ca3ecbf685624e 100644 (file)
@@ -136,6 +136,7 @@ void epggrab_ota_load ( void )
       if ((l = htsmsg_get_list_by_field(f)))
         _epggrab_ota_load_one((epggrab_module_ota_t*)mod, l);
     }
+    htsmsg_destroy(m);
   }
 }
 
@@ -171,6 +172,7 @@ void epggrab_ota_save ( void )
   }
 
   hts_settings_save(m, "epggrab/otamux");
+  htsmsg_destroy(m);
 }
 
 /* **************************************************************************
index 263bb6ce7f3e9b68cbc8fd159a0a6bb0f37e23f1..1a6f4540dcba2fd9adad71877265102b88f76924 100644 (file)
@@ -272,7 +272,7 @@ main(int argc, char **argv)
   htsp_port = 9982;
 
   /* Get current directory */
-  tvheadend_cwd = dirname(dirname(strdup(argv[0])));
+  tvheadend_cwd = dirname(dirname(tvh_strdupa(argv[0])));
 
   /* Set locale */
   setlocale(LC_ALL, "");