From c29d8b418ace3310431ec03fb8d3195fd9afea72 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Tue, 3 Dec 2019 11:31:39 +0000 Subject: [PATCH] fix coverity va_list issues --- lib/include/srslte/common/multiqueue.h | 1 + lib/include/srslte/common/test_common.h | 5 ++++- lib/src/asn1/rrc_asn1_utils.cc | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/common/multiqueue.h b/lib/include/srslte/common/multiqueue.h index 2dd6fd0e1..2393678b5 100644 --- a/lib/include/srslte/common/multiqueue.h +++ b/lib/include/srslte/common/multiqueue.h @@ -242,6 +242,7 @@ public: private: struct base_task { + virtual ~base_task() {} virtual void operator()() = 0; }; template diff --git a/lib/include/srslte/common/test_common.h b/lib/include/srslte/common/test_common.h index b4a1cf4b0..55fd46118 100644 --- a/lib/include/srslte/common/test_common.h +++ b/lib/include/srslte/common/test_common.h @@ -110,6 +110,7 @@ public: va_list args; va_start(args, message); log_va_list(LOG_LEVEL_DEBUG, message, args); + va_end(args); } void info(const char* message, ...) override __attribute__((format(printf, 2, 3))) @@ -117,6 +118,7 @@ public: va_list args; va_start(args, message); log_va_list(LOG_LEVEL_INFO, message, args); + va_end(args); } void warning(const char* message, ...) override __attribute__((format(printf, 2, 3))) @@ -125,6 +127,7 @@ public: va_list args; va_start(args, message); log_va_list(LOG_LEVEL_WARNING, message, args); + va_end(args); } void error(const char* message, ...) override __attribute__((format(printf, 2, 3))) @@ -133,6 +136,7 @@ public: va_list args; va_start(args, message); log_va_list(LOG_LEVEL_ERROR, message, args); + va_end(args); if (exit_on_error) { exit(-1); } @@ -151,7 +155,6 @@ private: last_log_msg = args_msg; } } - va_end(argp); } }; diff --git a/lib/src/asn1/rrc_asn1_utils.cc b/lib/src/asn1/rrc_asn1_utils.cc index 5819c8460..695a55eb4 100644 --- a/lib/src/asn1/rrc_asn1_utils.cc +++ b/lib/src/asn1/rrc_asn1_utils.cc @@ -167,6 +167,7 @@ void to_asn1(asn1::rrc::rlc_cfg_c* asn1_type, const srslte::rlc_config_t& cfg) (asn1::rrc::sn_field_len_opts::options)cfg.um.rx_sn_field_length; asn1_type->um_bi_dir().ul_um_rlc.sn_field_len.value = (asn1::rrc::sn_field_len_opts::options)cfg.um.tx_sn_field_length; + break; case rlc_mode_t::am: asn1_type->set_am(); asn1::number_to_enum(asn1_type->am().ul_am_rlc.t_poll_retx, cfg.am.t_poll_retx);