]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
buffer: init data val in ctor
authorSage Weil <sage@inktank.com>
Fri, 28 Sep 2012 01:13:24 +0000 (18:13 -0700)
committerSage Weil <sage@inktank.com>
Fri, 28 Sep 2012 20:18:04 +0000 (13:18 -0700)
CID 717213: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "data" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/buffer.cc

index 6091e0c4e9d17739901c293d5b50da4cdc8e8063..60c36a6f728e42619394ce035c6f839ea7b3a516 100644 (file)
@@ -60,7 +60,7 @@ bool buffer_track_alloc = get_env_bool("CEPH_BUFFER_TRACK");
     unsigned len;
     atomic_t nref;
 
-    raw(unsigned l) : len(l), nref(0)
+    raw(unsigned l) : data(NULL), len(l), nref(0)
     { }
     raw(char *c, unsigned l) : data(c), len(l), nref(0)
     { }