From d174ed2e4add43aae392fe7a228099d44b8e4c65 Mon Sep 17 00:00:00 2001 From: yuliyang_yewu Date: Tue, 17 Aug 2021 11:04:02 +0800 Subject: [PATCH] rgw: fix sts memory leak fix https://tracker.ceph.com/issues/52290 Signed-off-by: yuliyang_yewu (cherry picked from commit ef921bcdaa78d33ed0611a60ec58826d8e6ccb45) --- src/rgw/rgw_rest_s3.cc | 2 +- src/rgw/rgw_sts.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index ac7d04098c0fc..52071cf09a593 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -5839,7 +5839,7 @@ rgw::auth::s3::STSEngine::get_session_token(const DoutPrefixProvider* dpp, const return -EINVAL; } string error; - auto* keyhandler = cryptohandler->get_key_handler(secret, error); + std::unique_ptr keyhandler(cryptohandler->get_key_handler(secret, error)); if (! keyhandler) { return -EINVAL; } diff --git a/src/rgw/rgw_sts.cc b/src/rgw/rgw_sts.cc index 9b28eca67802f..050c0a10ae559 100644 --- a/src/rgw/rgw_sts.cc +++ b/src/rgw/rgw_sts.cc @@ -78,7 +78,7 @@ int Credentials::generateCredentials(CephContext* cct, return ret; } string error; - auto* keyhandler = cryptohandler->get_key_handler(secret, error); + std::unique_ptr keyhandler(cryptohandler->get_key_handler(secret, error)); if (! keyhandler) { return -EINVAL; } -- 2.39.5