]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
add missing locks and minor fixes
authorTrujulu <trujulu@gmail.com>
Tue, 6 Jan 2026 16:14:25 +0000 (17:14 +0100)
committerFlole <Flole998@users.noreply.github.com>
Fri, 9 Jan 2026 23:39:35 +0000 (00:39 +0100)
src/channels.c
src/input/mpegts/iptv/iptv.c
src/input/mpegts/iptv/iptv_http.c

index 521a6e0f5b8664a81d3006d029b0e0460ab2a721..0ea198cf103c1d9333658df7779454440b688e0d 100644 (file)
@@ -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;
       }
index 17d2c2701638ccc58dfd524b15ffefa4a3dd77ea..0fe2949d8d932e2c088b5c9a429476de5561ba29 100644 (file)
@@ -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);
index 038e51b3d089be7d8a0e39c95bc61b291aeccdff..329436ca208c40125c88e14c07d72ce2d9bde18f 100644 (file)
@@ -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 {