Plug some memory leaks

This commit is contained in:
Andreas Öman 2012-10-25 11:51:03 +02:00
parent 0bde079fda
commit c8e56a2865
3 changed files with 11 additions and 3 deletions

View file

@ -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")))

View 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);
}
/* **************************************************************************

View 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, "");