Skip to content

Commit

Permalink
util: Initialization of member of class ConcurrentArena
Browse files Browse the repository at this point in the history
Fixes the coverity issue:

** 1396145 Uninitialized pointer field

CID 1396145 (ceph#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member free_begin_ is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
  • Loading branch information
amitkuma committed Sep 5, 2017
1 parent 06b37ee commit 7cfc436
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/concurrent_arena.h
Expand Up @@ -88,7 +88,7 @@ class ConcurrentArena : public Allocator {
struct Shard {
char padding[40] ROCKSDB_FIELD_UNUSED;
mutable SpinMutex mutex;
char* free_begin_;
char* free_begin_ = nullptr;
std::atomic<size_t> allocated_and_unused_;

Shard() : allocated_and_unused_(0) {}
Expand Down

0 comments on commit 7cfc436

Please sign in to comment.