From 0db72cad96cd53399c8275c47b9f5f57967a2fd1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 29 Nov 2024 13:04:26 +0100 Subject: [PATCH] Fix warning raised by GCC 14 (-Wfree-nonheap-object) --- src/core/libs/osnma_msg_receiver.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/core/libs/osnma_msg_receiver.cc b/src/core/libs/osnma_msg_receiver.cc index 9e07f998c..1999a0cbb 100644 --- a/src/core/libs/osnma_msg_receiver.cc +++ b/src/core/libs/osnma_msg_receiver.cc @@ -1327,13 +1327,8 @@ std::vector osnma_msg_receiver::get_merkle_tree_leaves(const DSM_PKR_me { // build base leaf m_i according to OSNMA SIS ICD v1.1, section 6.2 DSM-PKR Verification std::vector m_i; - const size_t size_npk = dsm_pkr_message.npk.size(); - m_i.reserve(1 + size_npk); - m_i.push_back((dsm_pkr_message.npkt << 4) + dsm_pkr_message.npktid); - for (size_t i = 0; i < size_npk; i++) - { - m_i.push_back(dsm_pkr_message.npk[i]); - } + m_i.push_back(static_cast((dsm_pkr_message.npkt << 4) + dsm_pkr_message.npktid)); + m_i.insert(m_i.end(), dsm_pkr_message.npk.begin(), dsm_pkr_message.npk.end()); return m_i; }