]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix more issues identified by coverity
authorFlole998 <Flole998@users.noreply.github.com>
Thu, 18 Feb 2021 21:24:01 +0000 (22:24 +0100)
committerGitHub <noreply@github.com>
Thu, 18 Feb 2021 21:24:01 +0000 (22:24 +0100)
src/config.c
src/dvr/dvr_db.c
src/htsp_server.c
src/satip/rtsp.c
src/tvh_thread.c

index 6b77000fb45c64448a9554814f81e6dd2f6ba28a..612698e8327f2a747bcb4fb920e0af46cec05833 100644 (file)
@@ -148,6 +148,8 @@ config_migrate_v1_dvb_svcs
       hts_settings_save(svc, "input/linuxdvb/networks/%s/muxes/%s/services/%s",
                         netu, muxu, uuid_get_hex(&svcu, ubuf));
 
+      htsmsg_destroy(svc);
+
       /* Map to channel */
       if ((str = htsmsg_get_str(e, "channelname")))
         config_migrate_v1_chn_add_svc(channels, str, ubuf);
@@ -1283,6 +1285,7 @@ config_migrate_v19 ( void )
       hts_settings_save(m, "passwd/%s", uuid_get_hex(&u, ubuf));
       htsmsg_delete_field(e, "password2");
       hts_settings_save(e, "accesscontrol/%s", htsmsg_field_name(f));
+      htsmsg_destroy(m);
     }
   }
   htsmsg_destroy(c);
index 0ae44395bb5a784ebba7cff2f8728f01ad28fec1..13de1de96060b4cff2d894b119b42d25579a2c7f 100644 (file)
@@ -3883,9 +3883,9 @@ dvr_entry_class_channel_icon_url_get(void *o)
 const char *
 dvr_entry_get_image(const dvr_entry_t *de)
 {
-  if (de->de_bcast && de->de_bcast && de->de_bcast->image)
+  if (de && de->de_bcast && de->de_bcast->image)
     return de->de_bcast->image;
-  if (de->de_image)
+  if (de && de->de_image)
     return de->de_image;
   return NULL;
 }
index 5cccb499fb2afb055e22154d9673ee158a571d97..6268cd61af73af2e82fa736e2857fe9942f19139 100644 (file)
@@ -598,7 +598,6 @@ htsp_serierec_convert(htsp_connection_t *htsp, htsmsg_t *in, channel_t *ch, int
   char ubuf[UUID_HEX_SIZE];
 
   conf = htsmsg_create_map();
-  days = htsmsg_create_list();
 
   if (autorec) { // autorec specific
     if (!(retval = htsmsg_get_u32(in, "minduration", &u32)) || add)
@@ -685,6 +684,7 @@ htsp_serierec_convert(htsp_connection_t *htsp, htsmsg_t *in, channel_t *ch, int
 
   /* Weekdays only if present */
   if(!(retval = htsmsg_get_u32(in, "daysOfWeek", &u32))) {
+    days = htsmsg_create_list();
     int i;
     for (i = 0; i < 7; i++)
       if (u32 & (1 << i))
@@ -697,8 +697,6 @@ htsp_serierec_convert(htsp_connection_t *htsp, htsmsg_t *in, channel_t *ch, int
     htsmsg_add_str(conf, "channel", ch ? idnode_uuid_as_str(&ch->ch_id, ubuf) : "");
   }
 
-  htsmsg_destroy(days);
-
   return conf;
 }
 
index 8db2d9e9b13fe8da42278720f443992106213fee..3bfab7122acc513ffeb0b810511acd4b792e39f0 100644 (file)
@@ -673,7 +673,7 @@ rtsp_start
     }
     if (rs->mux == mux && rs->subs) {
       if (rs->no_data) {
-       dvb_mux_conf_str(&rs->dmc, buf, sizeof(buf));
+        dvb_mux_conf_str(&rs->dmc, buf, sizeof(buf));
         tvhwarn(LS_SATIPS, "%i/%s/%i: subscription fails because mux %s can't tune",
                 rs->frontend, rs->session, rs->stream, buf);
         goto endclean;
index e0f5d02ebb45a69c34688787235ea4ee5b80f2ad..3042649b736f00492981e525842d1cfbcfa2163b 100644 (file)
@@ -189,7 +189,7 @@ static void tvh_mutex_add_to_list(tvh_mutex_t *mutex, const char *filename, int
 static void tvh_mutex_check_interval(tvh_mutex_t *mutex)
 {
   if (tvh_thread_debug > 10000) {
-    int64_t ms = (tvh_thread_debug - 10000) * 1000;
+    int64_t ms = ((int64_t)tvh_thread_debug - 10000) * 1000;
     int64_t diff = getfastmonoclock() - mutex->tstamp;
     if (diff > ms)
       tvhdbg(LS_THREAD, "mutex %p at %s:%d took %lldms",