From: Trujulu Date: Tue, 6 Jan 2026 16:14:25 +0000 (+0100) Subject: add missing locks and minor fixes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62511adbe4bf1ec0faea06eec664c3e0f07a6d41;p=thirdparty%2Ftvheadend.git add missing locks and minor fixes --- diff --git a/src/channels.c b/src/channels.c index 521a6e0f5..0ea198cf1 100644 --- a/src/channels.c +++ b/src/channels.c @@ -131,13 +131,15 @@ channel_class_autoname_set ( void *obj, const void *p ) { channel_t *ch = (channel_t *)obj; const char *s; + char *chan_name; int b = *(int *)p; if (ch->ch_autoname != b) { if (b == 0 && tvh_str_default(ch->ch_name, NULL) == NULL) { s = channel_get_name(ch, NULL); if (s) { + chan_name = strdup(s); free(ch->ch_name); - ch->ch_name = strdup(s); + ch->ch_name = chan_name; } else { return 0; } diff --git a/src/input/mpegts/iptv/iptv.c b/src/input/mpegts/iptv/iptv.c index 17d2c2701..0fe2949d8 100644 --- a/src/input/mpegts/iptv/iptv.c +++ b/src/input/mpegts/iptv/iptv.c @@ -576,6 +576,7 @@ iptv_input_thread ( void *aux ) if ((n = im->im_handler->read(mi, im)) < 0) { tvherror(LS_IPTV, "read() error %s", strerror(errno)); im->im_handler->stop(mi, im); + tvh_mutex_unlock(&iptv_lock); break; } r = iptv_input_recv_packets(im, n); diff --git a/src/input/mpegts/iptv/iptv_http.c b/src/input/mpegts/iptv/iptv_http.c index 038e51b3d..329436ca2 100644 --- a/src/input/mpegts/iptv/iptv_http.c +++ b/src/input/mpegts/iptv/iptv_http.c @@ -473,7 +473,6 @@ url: free(hp->hls_url_after_key); hp->hls_url_after_key = url; url = strdup(s); - free(absolute_key_url); hc->hc_data_complete = iptv_http_complete_key; sbuf_reset(&hp->key_sbuf, 32); } @@ -487,6 +486,7 @@ new_m3u: iptv_http_reconnect(hc, url); end: free(url); + free(absolute_key_url); fin: htsmsg_destroy(m); } else {