rgw: fix resource leak in rgw_bucket.cc and rgw_user.cc

Fixes: http://tracker.ceph.com/issues/21214

Signed-off-by: Luo Kexue <luo.kexue@zte.com.cn>
This commit is contained in:
Luo Kexue 2017-08-30 09:32:18 +08:00
parent 1b2f1358f7
commit 1f23976ada
2 changed files with 8 additions and 6 deletions

View File

@ -12,6 +12,7 @@
#include "common/errno.h"
#include "common/ceph_json.h"
#include "common/backport14.h"
#include "rgw_rados.h"
#include "rgw_acl.h"
#include "rgw_acl_s3.h"
@ -2162,7 +2163,7 @@ public:
}
int list_keys_init(RGWRados *store, const string& marker, void **phandle) override {
list_keys_info *info = new list_keys_info;
auto info = ceph::make_unique<list_keys_info>();
info->store = store;
@ -2171,7 +2172,7 @@ public:
if (ret < 0) {
return ret;
}
*phandle = (void *)info;
*phandle = (void *)info.release();
return 0;
}
@ -2361,7 +2362,7 @@ public:
}
int list_keys_init(RGWRados *store, const string& marker, void **phandle) override {
list_keys_info *info = new list_keys_info;
auto info = ceph::make_unique<list_keys_info>();
info->store = store;
@ -2370,7 +2371,7 @@ public:
if (ret < 0) {
return ret;
}
*phandle = (void *)info;
*phandle = (void *)info.release();
return 0;
}

View File

@ -11,6 +11,7 @@
#include "common/Formatter.h"
#include "common/ceph_json.h"
#include "common/RWLock.h"
#include "common/backport14.h"
#include "rgw_rados.h"
#include "rgw_acl.h"
@ -2774,7 +2775,7 @@ public:
int list_keys_init(RGWRados *store, const string& marker, void **phandle) override
{
list_keys_info *info = new list_keys_info;
auto info = ceph::make_unique<list_keys_info>();
info->store = store;
@ -2784,7 +2785,7 @@ public:
return ret;
}
*phandle = (void *)info;
*phandle = (void *)info.release();
return 0;
}