}
}
- tvh_qsort_r(bcast_entries, num_entries, sizeof(bcast_entry_t), api_epg_sort_by_time_t, 0);
+ if(bcast_entries != NULL)
+ tvh_qsort_r(bcast_entries, num_entries, sizeof(bcast_entry_t), api_epg_sort_by_time_t, 0);
for (i=0; i<num_entries; ++i) {
htsmsg_t *m = bcast_entries[i].m;
( 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, *title_esc, *title_anchor;
epg_set_t *serieslink = NULL;
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);
/* Build entry */
uuid_set(&chnu, NULL);
+ if(m != NULL) htsmsg_destroy(m);
m = htsmsg_create_map();
htsmsg_add_u32(m, "channelid", atoi(htsmsg_field_name(f)));
htsmsg_add_str(m, "uuid", uuid_get_hex(&chnu, ubufc));
break;
case 0x1f: /* Described by encoding_type_id, TS 101 162 */
- if (srclen < 1)
- return -1;
return -1; /* NYI */
default:
/* do the proper split */
if (pcnt > 0) {
snprintf(buf, sizeof(buf), "pids=%s%s", p[0], _w);
- satip_rtsp_play0(hc, index++, stream, buf);
+ r = satip_rtsp_play0(hc, index++, stream, buf);
+ if (r < 0)
+ return r;
for (i = 1; i < pcnt; i++) {
snprintf(buf, sizeof(buf), "addpids=%s%s", p[i], _w);
r = satip_rtsp_play0(hc, index++, stream, buf);
str++;
}
}
- if (!reg)
+ if (!reg) {
+ free(buf);
return -1;
+ }
/* Network */
str = buf;
htsmsg_t *conf;
conf = hts_settings_load("input/tvhdhomerun/adapters/%s", hd->hd_info.uuid);
- if (conf)
- conf = htsmsg_get_map(conf, "frontends");
+ if (conf) {
+ htsmsg_t *subconf = htsmsg_get_map(conf, "frontends");
+ htsmsg_destroy(conf);
+ conf = subconf;
+ }
lock_assert(&global_lock);
parser_rstlog(parser_t *t, th_pkt_t *pkt)
{
streaming_message_t *sm = streaming_msg_create_pkt(pkt);
- pkt_ref_dec(pkt); /* streaming_msg_create_pkt increses ref counter */
streaming_message_t *clone = streaming_msg_clone(sm);
+ streaming_msg_free(sm);
TAILQ_INSERT_TAIL (&t->prs_rstlog, clone, sm_link);
}