From: Yehuda Sadeh Date: Tue, 16 Oct 2012 21:13:01 +0000 (-0700) Subject: rgw: multiple coverity fixes X-Git-Tag: v0.54~39 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d2afddd457ae67ad3fd27553ea5e424f47ac389e;p=ceph.git rgw: multiple coverity fixes Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 07451e39393..b0460929da8 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -60,7 +60,7 @@ rgw_err() rgw_err:: rgw_err(int http, const std::string& s3) - : http_ret(http), s3_code(s3) + : http_ret(http), ret(0), s3_code(s3) { } @@ -121,6 +121,8 @@ req_state::req_state(CephContext *_cct, struct RGWEnv *e) : cct(_cct), cio(NULL) length = NULL; copy_source = NULL; http_auth = NULL; + + obj_ctx = NULL; } req_state::~req_state() { diff --git a/src/rgw/rgw_dencoder.cc b/src/rgw/rgw_dencoder.cc index 7e3701aa24f..00015ff022c 100644 --- a/src/rgw/rgw_dencoder.cc +++ b/src/rgw/rgw_dencoder.cc @@ -42,6 +42,8 @@ void RGWObjManifest::generate_test_instances(std::list& o) } m->obj_size = 5 * 1024 * 1024; + o.push_back(m); + o.push_back(new RGWObjManifest); } diff --git a/src/rgw/rgw_multiparser.cc b/src/rgw/rgw_multiparser.cc index 58e8751cc7e..2f4d8d94bee 100644 --- a/src/rgw/rgw_multiparser.cc +++ b/src/rgw/rgw_multiparser.cc @@ -30,7 +30,10 @@ int main(int argc, char **argv) { } done = feof(stdin); - parser.parse(buf, len, done); + bool result = parser.parse(buf, len, done); + if (!result) { + cerr << "failed to parse!" << std::endl; + } if (done) break; diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index 463765a7a23..f99a38b5c08 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -32,7 +32,7 @@ protected: RGWHandler *dialect_handler; RGWRados *store; public: - RGWOp() : s(NULL), dialect_handler(NULL) {} + RGWOp() : s(NULL), store(NULL), dialect_handler(NULL) {} virtual ~RGWOp() {} virtual void init(RGWRados *store, struct req_state *s, RGWHandler *dialect_handler) { @@ -682,7 +682,7 @@ protected: virtual RGWOp *op_post() { return NULL; } virtual RGWOp *op_copy() { return NULL; } public: - RGWHandler() : s(NULL) {} + RGWHandler() : store(NULL), s(NULL) {} virtual ~RGWHandler(); virtual int init(RGWRados *store, struct req_state *_s, RGWClientIO *cio); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index bc64d4adaa3..4a932224a92 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -163,7 +163,7 @@ struct RGWRadosCtx { int (*intent_cb)(RGWRados *store, void *user_ctx, rgw_obj& obj, RGWIntentEvent intent); void *user_ctx; - RGWRadosCtx(RGWRados *_store) : store(_store) { } + RGWRadosCtx(RGWRados *_store) : store(_store), intent_cb(NULL), user_ctx(NULL) { } RGWObjState *get_state(rgw_obj& obj); void set_atomic(rgw_obj& obj);