]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: initialize Non-static class member worker in RGWReshard
authorJos Collin <jcollin@redhat.com>
Fri, 23 Jun 2017 15:33:11 +0000 (21:03 +0530)
committerJos Collin <jcollin@redhat.com>
Fri, 23 Jun 2017 15:34:35 +0000 (21:04 +0530)
Fixes the Coverity Scan Report:
CID 1412616 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member worker is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <jcollin@redhat.com>
src/rgw/rgw_reshard.cc
src/rgw/rgw_reshard.h

index adf3351dc55f54b3738174a0f447a69234a13a5b..12c324e721940a8bd06cf87005eec9b9d791f19c 100644 (file)
@@ -885,7 +885,7 @@ void RGWReshard::stop_processor()
     worker->join();
   }
   delete worker;
-  worker = NULL;
+  worker = nullptr;
 }
 
 void *RGWReshard::ReshardWorker::entry() {
index 9873707f97d35a187f61e2210460114c4e9e15b8..8c1734b8951b1b16c8975bec4bce83af35f9d3a2 100644 (file)
@@ -78,7 +78,7 @@ protected:
     void stop();
   };
 
-  ReshardWorker *worker;
+  ReshardWorker *worker = nullptr;
   std::atomic<bool> down_flag = { false };
 
   string get_logshard_key(const string& tenant, const string& bucket_name);