Skip to content

Commit c0f6e1d

Browse files
authored
Merge pull request ceph#57612 from Svelar/asan_rgw_kms
rgw_kms: fix Realloc and free cct
2 parents 309caf3 + 009f61b commit c0f6e1d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/rgw/rgw_kms.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ class ZeroPoolAllocator {
8080
return r;
8181
}
8282
void* Realloc(void* p, size_t old, size_t nw) {
83-
void *r = nullptr;
84-
if (nw) r = malloc(nw);
83+
if (!nw) return 0;
84+
void *r = Malloc(nw);
8585
if (nw > old) nw = old;
8686
if (r && old) memcpy(r, p, nw);
8787
return r;

src/test/rgw/test_rgw_kms.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class TestSSEKMS : public ::testing::Test {
5656
delete old_engine;
5757
delete kv_engine;
5858
delete transit_engine;
59+
delete cct;
5960
}
6061

6162
};

0 commit comments

Comments
 (0)