( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
uint32_t id, entries = 0;
- htsmsg_t *l = htsmsg_create_list();
+ htsmsg_t *l;
epg_broadcast_t *e;
char *lang;
if (htsmsg_get_u32(args, "eventId", &id))
return EINVAL;
+ l = htsmsg_create_list();
+
/* Main Job */
lang = access_get_lang(perm, htsmsg_get_str(args, "lang"));
tvh_mutex_lock(&global_lock);
/* Have to unlock here since grid will re-lock */
tvh_mutex_unlock(&global_lock);
free(lang);
+ htsmsg_destroy(l);
/* And let the grid do the query for us */
return api_epg_grid(perm, opaque, op, args, resp);
}
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
uint32_t id = 0, entries = 0;
- htsmsg_t *l = htsmsg_create_list(), *ids = NULL, *m;
+ htsmsg_t *l, *ids = NULL, *m;
htsmsg_field_t *f;
epg_broadcast_t *e;
const char *blank = NULL;
if (htsmsg_field_get_u32(f, &id))
return EINVAL;
+ l = htsmsg_create_list();
+
/* Main Job */
tvh_mutex_lock(&global_lock);
lang = access_get_lang(perm, htsmsg_get_str(args, "lang"));
/* Load the adapter config */
if (!(tun = hts_settings_load("dvbadapters/%s", name))) return;
- if (!(str = htsmsg_get_str(tun, "type"))) return;
+ if (!(str = htsmsg_get_str(tun, "type"))) {
+ htsmsg_destroy(tun);
+ return;
+ }
type = str;
/* Create network entry */
htsmsg_add_str(net, "networkname", name);
hts_settings_save(net, "input/linuxdvb/networks/%s/config",
uuid_get_hex(&netu, ubuf));
+ htsmsg_destroy(tun);
htsmsg_destroy(net);
}
config_migrate_v1 ( void )
{
tvh_uuid_t netu, muxu, svcu, chnu;
- htsmsg_t *c, *m, *e, *l;
+ htsmsg_t *c, *e, *l, *m = NULL;
htsmsg_field_t *f;
uint32_t u32;
const char *str;
/* Create a network */
uuid_set(&netu, NULL);
+ if(m != NULL) htsmsg_destroy(m);
m = htsmsg_create_map();
htsmsg_add_str(m, "networkname", "IPTV Network");
htsmsg_add_u32(m, "skipinitscan", 1);
hts_settings_remove("autorec/%s", htsmsg_field_name(f));
hts_settings_save(e, "dvr/autorec/%s", htsmsg_field_name(f));
}
+ htsmsg_destroy(c);
}
}
if (dvr_autorec_entry_can_be_purged(de)) {
dvr_entry_assign_broadcast(de, NULL);
dvr_entry_destroy(de, 1);
+ de = NULL;
}
}
{
const dvr_entry_t *de = (dvr_entry_t *)o;
htsmsg_t *l = htsmsg_create_list();
- if (de->de_bcast && de->de_bcast) {
+ if (de && de->de_bcast) {
epg_genre_t *eg;
LIST_FOREACH(eg, &de->de_bcast->genre, link) {
htsmsg_add_u32(l, NULL, eg->code);
/* Add event entry */
static void opentv_add_entry(opentv_status_t *sta, opentv_event_t *ev)
{
+ if (sta == NULL) return;
+
opentv_entry_t *entry, *nentry = calloc(1, sizeof(*nentry));
- if (sta == NULL) return;
nentry->event = *ev;
entry = RB_INSERT_SORTED(&sta->os_entries, nentry, link, _entry_cmp);
if (entry) {
if (ch || !add) {
htsmsg_add_str(conf, "channel", ch ? idnode_uuid_as_str(&ch->ch_id, ubuf) : "");
}
+
+ htsmsg_destroy(days);
+
return conf;
}
tvhpoll_t *efd = NULL;
http_client_t *hc = NULL;
+ urlinit(&url);
+
lock_assert(&imagecache_lock);
if (img->url == NULL || img->url[0] == '\0')
/* Fetch (release lock, incase of delays) */
tvh_mutex_unlock(&imagecache_lock);
- urlinit(&url);
-
/* Build command */
tvhdebug(LS_IMAGECACHE, "fetch %s", img->url);
memset(&url, 0, sizeof(url));
}
break;
case DVB_DESC_APP_NAME:
+ if(titles != NULL) htsmsg_destroy(titles);
titles = htsmsg_create_list();
while (dlen > 4) {
r = dvb_get_string_with_len(title, sizeof(title), dptr + 3, dlen - 3, "UTF-8", NULL);
htsmsg_destroy(key);
if (l == NULL)
l = htsmsg_create_list();
+ if (item != NULL)
+ htsmsg_destroy(item);
htsmsg_add_msg(m, "items", l);
return m;
}
break;
tvhdbg(LS_THREAD, "%s", s2);
}
+ if (fd != fd_stderr) close(fd);
}
#endif