diff options
author | Casey Bodley <cbodley@redhat.com> | 2019-07-29 21:18:24 +0200 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2019-07-29 21:20:50 +0200 |
commit | eba7324b577e2502c9b99b3e6e0dad6f378f053c (patch) | |
tree | c5185cf90b2b4e1eb1a1dba2d63ee1faed01fba0 /src/rgw/rgw_metadata.cc | |
parent | rgw: user service removes old access keys in remove_old_indexes (diff) | |
download | ceph-eba7324b577e2502c9b99b3e6e0dad6f378f053c.tar.xz ceph-eba7324b577e2502c9b99b3e6e0dad6f378f053c.zip |
rgw: fix leak of metadata backend context
Op had no virtual destructor, so the derived Op_ManagedCtx destructor
wasn't being called to free its context. just use Op_ManagedCtx directly
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/rgw_metadata.cc')
-rw-r--r-- | src/rgw/rgw_metadata.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index c9395a26c51..aa50519632e 100644 --- a/src/rgw/rgw_metadata.cc +++ b/src/rgw/rgw_metadata.cc @@ -527,7 +527,7 @@ int RGWMetadataHandler_GenericMetaBE::get_shard_id(const string& entry, int *sha int RGWMetadataHandler_GenericMetaBE::list_keys_init(const string& marker, void **phandle) { - std::unique_ptr<RGWSI_MetaBackend_Handler::Op> op(be_handler->alloc_op()); + auto op = std::make_unique<RGWSI_MetaBackend_Handler::Op_ManagedCtx>(be_handler); int ret = op->list_init(marker); if (ret < 0) { @@ -541,7 +541,7 @@ int RGWMetadataHandler_GenericMetaBE::list_keys_init(const string& marker, void int RGWMetadataHandler_GenericMetaBE::list_keys_next(void *handle, int max, list<string>& keys, bool *truncated) { - auto op = static_cast<RGWSI_MetaBackend_Handler::Op *>(handle); + auto op = static_cast<RGWSI_MetaBackend_Handler::Op_ManagedCtx *>(handle); int ret = op->list_next(max, &keys, truncated); if (ret < 0 && ret != -ENOENT) { @@ -559,13 +559,13 @@ int RGWMetadataHandler_GenericMetaBE::list_keys_next(void *handle, int max, list void RGWMetadataHandler_GenericMetaBE::list_keys_complete(void *handle) { - auto op = static_cast<RGWSI_MetaBackend_Handler::Op *>(handle); + auto op = static_cast<RGWSI_MetaBackend_Handler::Op_ManagedCtx *>(handle); delete op; } string RGWMetadataHandler_GenericMetaBE::get_marker(void *handle) { - auto op = static_cast<RGWSI_MetaBackend_Handler::Op *>(handle); + auto op = static_cast<RGWSI_MetaBackend_Handler::Op_ManagedCtx *>(handle); string marker; int r = op->list_get_marker(&marker); if (r < 0) { |