From: Casey Bodley Date: Tue, 24 May 2016 16:57:19 +0000 (-0400) Subject: rgw: don't leak RGWRados::cr_registry on error X-Git-Tag: v11.0.0~340^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=53a7f1a9951fa21cb46b5fb3914db3547b568aa5;p=ceph.git rgw: don't leak RGWRados::cr_registry on error Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 7d21e2f7c97c..60430c4b4b0c 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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{ + 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;