diff --git a/src/rgw/rgw_kms.cc b/src/rgw/rgw_kms.cc index ea30ff868fd97..d5854ccea927a 100644 --- a/src/rgw/rgw_kms.cc +++ b/src/rgw/rgw_kms.cc @@ -80,8 +80,8 @@ class ZeroPoolAllocator { return r; } void* Realloc(void* p, size_t old, size_t nw) { - void *r = nullptr; - if (nw) r = malloc(nw); + if (!nw) return 0; + void *r = Malloc(nw); if (nw > old) nw = old; if (r && old) memcpy(r, p, nw); return r; diff --git a/src/test/rgw/test_rgw_kms.cc b/src/test/rgw/test_rgw_kms.cc index 9fc6145d2fe77..409c56d2c3e1f 100644 --- a/src/test/rgw/test_rgw_kms.cc +++ b/src/test/rgw/test_rgw_kms.cc @@ -56,6 +56,7 @@ class TestSSEKMS : public ::testing::Test { delete old_engine; delete kv_engine; delete transit_engine; + delete cct; } };