From 0ba5fba94205eb2c42455dba2f8579bdaab3322b Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Sun, 4 Oct 2020 18:05:34 +0300 Subject: [PATCH] rgw/kafka: fix potential crash when accessing tags issues were detected by pvs-studio static analyzer Signed-off-by: Yuval Lifshitz --- src/rgw/rgw_kafka.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_kafka.cc b/src/rgw/rgw_kafka.cc index dfaefdfb270..1e8af36ba87 100644 --- a/src/rgw/rgw_kafka.cc +++ b/src/rgw/rgw_kafka.cc @@ -64,7 +64,7 @@ struct connection_t { std::vector topics; bool marked_for_deletion = false; uint64_t delivery_tag = 1; - int status; + int status = STATUS_OK; mutable std::atomic ref_count = 0; CephContext* const cct; CallbackList callbacks; @@ -371,6 +371,7 @@ private: } conn->destroy(err); delete tag; + return; } if (tag) {