]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't leak RGWRados::cr_registry on error 9295/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 24 May 2016 16:57:19 +0000 (12:57 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 24 May 2016 16:57:19 +0000 (12:57 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc

index 7d21e2f7c97c5679c0535e84fb843f35d4f8b289..60430c4b4b0c3cb5bce68c9f71d73c1448913140 100644 (file)
@@ -3213,14 +3213,16 @@ int RGWRados::init_rados()
     }
   }
 
-  cr_registry = new RGWCoroutinesManagerRegistry(cct);
-  ret =  cr_registry->hook_to_admin_command("cr dump");
+  auto crs = std::unique_ptr<RGWCoroutinesManagerRegistry>{
+    new RGWCoroutinesManagerRegistry(cct)};
+  ret = crs->hook_to_admin_command("cr dump");
   if (ret < 0) {
     return ret;
   }
 
   meta_mgr = new RGWMetadataManager(cct, this);
   data_log = new RGWDataChangesLog(cct, this);
+  cr_registry = crs.release();
 
   std::swap(handles, rados);
   return ret;