From 9c731ed6b606e39000025ab569f412ece0cc7fce Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 4 Nov 2016 12:18:32 -0400 Subject: [PATCH] rgw: delete entries_index in RGWFetchAllMetaCR use a unique_ptr to ensure the entries_index is freed on destruction Fixes: http://tracker.ceph.com/issues/17812 Signed-off-by: Casey Bodley --- src/rgw/rgw_sync.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index b34e7fe6891..e78dc98d2a7 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -735,7 +735,7 @@ class RGWFetchAllMetaCR : public RGWCoroutine { list result; list::iterator iter; - RGWShardedOmapCRManager *entries_index; + std::unique_ptr entries_index; RGWContinuousLeaseCR *lease_cr; RGWCoroutinesStack *lease_stack; @@ -748,7 +748,7 @@ public: RGWFetchAllMetaCR(RGWMetaSyncEnv *_sync_env, int _num_shards, map& _markers) : RGWCoroutine(_sync_env->cct), sync_env(_sync_env), num_shards(_num_shards), - ret_status(0), entries_index(NULL), lease_cr(nullptr), lease_stack(nullptr), + ret_status(0), lease_cr(nullptr), lease_stack(nullptr), lost_lock(false), failed(false), markers(_markers) { } @@ -805,9 +805,9 @@ public: set_sleeping(true); yield; } - entries_index = new RGWShardedOmapCRManager(sync_env->async_rados, sync_env->store, this, num_shards, - sync_env->store->get_zone_params().log_pool, - mdlog_sync_full_sync_index_prefix); + entries_index.reset(new RGWShardedOmapCRManager(sync_env->async_rados, sync_env->store, this, num_shards, + sync_env->store->get_zone_params().log_pool, + mdlog_sync_full_sync_index_prefix)); yield { call(new RGWReadRESTResourceCR >(cct, conn, sync_env->http_manager, "/admin/metadata", NULL, §ions)); -- 2.47.3