]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: multiple coverity fixes
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 16 Oct 2012 21:13:01 +0000 (14:13 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 16 Oct 2012 21:13:38 +0000 (14:13 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_common.cc
src/rgw/rgw_dencoder.cc
src/rgw/rgw_multiparser.cc
src/rgw/rgw_op.h
src/rgw/rgw_rados.h

index 07451e39393288413ad78863baf20a3bc31bb3a7..b0460929da8086e564308a1a8f77a27106eee925 100644 (file)
@@ -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() {
index 7e3701aa24f651c058142785149f0a212a0a2f68..00015ff022cbf9fc0a78d334248fe15bff3829f9 100644 (file)
@@ -42,6 +42,8 @@ void RGWObjManifest::generate_test_instances(std::list<RGWObjManifest*>& o)
   }
   m->obj_size = 5 * 1024 * 1024;
 
+  o.push_back(m);
+
   o.push_back(new RGWObjManifest);
 }
 
index 58e8751cc7eff47e33c5f811dded8405c93a87cd..2f4d8d94bee4f3e1259cc1a4939f7072304e44b2 100644 (file)
@@ -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;
index 463765a7a230b78bb551506e99e9cfb18929670a..f99a38b5c08505bb76490fe102c8ff990736c92e 100644 (file)
@@ -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);
 
index bc64d4adaa39283bba81493e57cd54e4f199cacc..4a932224a9211f3b2f71c499d3ba8489ae90fafd 100644 (file)
@@ -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);