]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/kafka: fix potential crash when accessing tags 37538/head
authorYuval Lifshitz <ylifshit@redhat.com>
Sun, 4 Oct 2020 15:05:34 +0000 (18:05 +0300)
committerYuval Lifshitz <ylifshit@redhat.com>
Tue, 6 Oct 2020 10:41:35 +0000 (13:41 +0300)
issues were detected by pvs-studio static analyzer

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_kafka.cc

index dfaefdfb270710f9165b23f7fe872f30398b131d..1e8af36ba879bfcdc20d5d2ea9214c37acdd6dd0 100644 (file)
@@ -64,7 +64,7 @@ struct connection_t {
   std::vector<rd_kafka_topic_t*> topics;
   bool marked_for_deletion = false;
   uint64_t delivery_tag = 1;
-  int status;
+  int status = STATUS_OK;
   mutable std::atomic<int> ref_count = 0;
   CephContext* const cct;
   CallbackList callbacks;
@@ -371,6 +371,7 @@ private:
       }
       conn->destroy(err);
       delete tag;
+      return;
     }
    
     if (tag) {