]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: Initializing uninitialized members MOSDAlive 16816/head
authoramitkuma <amitkuma@redhat.com>
Fri, 4 Aug 2017 14:50:08 +0000 (20:20 +0530)
committeramitkuma <amitkuma@redhat.com>
Fri, 4 Aug 2017 14:50:08 +0000 (20:20 +0530)
Fixes coverity Issue:

** 717300 Uninitialized scalar field
CID 717300 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member want is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar amitkuma@redhat.com
src/messages/MOSDAlive.h

index aacffa932c12ed3d31aa58157e2fcef1525c8af0..82b52e9cc1456887358c530c499b6f0919a42253 100644 (file)
@@ -21,7 +21,7 @@
 
 class MOSDAlive : public PaxosServiceMessage {
  public:
-  epoch_t want;
+  epoch_t want = 0;
 
   MOSDAlive(epoch_t h, epoch_t w) : PaxosServiceMessage(MSG_OSD_ALIVE, h), want(w) { }
   MOSDAlive() : PaxosServiceMessage(MSG_OSD_ALIVE, 0) {}