From ba97e1ac82501f48c6a01126e59c45189bd9e6be Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Mon, 17 Jun 2024 19:30:20 +0000 Subject: [PATCH] rgw/amqp: fix valgrind errors on uninitialized memory Fixes: https://tracker.ceph.com/issues/64690 Signed-off-by: Yuval Lifshitz --- src/rgw/rgw_amqp.cc | 8 ++++---- src/rgw/rgw_amqp.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rgw/rgw_amqp.cc b/src/rgw/rgw_amqp.cc index e676b7b044b..0e4025516a0 100644 --- a/src/rgw/rgw_amqp.cc +++ b/src/rgw/rgw_amqp.cc @@ -513,10 +513,10 @@ bool new_state(connection_t* conn, const connection_id_t& conn_id) { /// struct used for holding messages in the message queue struct message_wrapper_t { - connection_id_t conn_id; - std::string topic; - std::string message; - reply_callback_t cb; + const connection_id_t conn_id; + const std::string topic; + const std::string message; + const reply_callback_t cb; message_wrapper_t(const connection_id_t& _conn_id, const std::string& _topic, diff --git a/src/rgw/rgw_amqp.h b/src/rgw/rgw_amqp.h index c363f4d7403..99bd3aef1ed 100644 --- a/src/rgw/rgw_amqp.h +++ b/src/rgw/rgw_amqp.h @@ -26,10 +26,10 @@ void shutdown(); // key class for the connection list struct connection_id_t { std::string host; - int port; + int port = 0; std::string vhost; std::string exchange; - bool ssl; + bool ssl = false; connection_id_t() = default; connection_id_t(const amqp_connection_info& info, const std::string& _exchange); }; -- 2.39.5