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: v10.2.3~112^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7af0306de5778340fc7c9395b237bf4e73716d0a;p=ceph.git rgw: don't leak RGWRados::cr_registry on error Signed-off-by: Casey Bodley (cherry picked from commit 53a7f1a9951fa21cb46b5fb3914db3547b568aa5) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 81fa6d3df2b2..6dfc5630c307 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3185,14 +3185,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;