From: Flole998 Date: Thu, 18 Feb 2021 21:24:01 +0000 (+0100) Subject: Fix more issues identified by coverity X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1619f9e44678dba5467e4ac94b3e47ea92b72f3e;p=thirdparty%2Ftvheadend.git Fix more issues identified by coverity --- diff --git a/src/config.c b/src/config.c index 6b77000fb..612698e83 100644 --- a/src/config.c +++ b/src/config.c @@ -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); diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index 0ae44395b..13de1de96 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -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; } diff --git a/src/htsp_server.c b/src/htsp_server.c index 5cccb499f..6268cd61a 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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; } diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 8db2d9e9b..3bfab7122 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -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; diff --git a/src/tvh_thread.c b/src/tvh_thread.c index e0f5d02eb..3042649b7 100644 --- a/src/tvh_thread.c +++ b/src/tvh_thread.c @@ -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",