Fix CI failure caused by PR #13231 (#13233)

For my mistake, in the last revert commit in #13231, I originally wanted
to revert the last one, but reverted the penultimate fix.
Now that we have fix another potential memory read issue in [`743f1dd`
(#13231)](743f1dde79),
now it just seems to avoid confusion, i will verify in the future
whether it will have any impact, if so we will add this PR to backport.

Failed CI: https://github.com/sundb/redis/actions/runs/8826731960
This commit is contained in:
debing.sun 2024-04-25 14:11:45 +08:00 committed by GitHub
parent 772564fc9e
commit f95031c473
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -869,8 +869,8 @@ void freeTestCallback(dict *d, void *val) {
zfree(val);
}
void* defragAllocTest(void *ptr) {
size_t size = zmalloc_size(ptr);
void *defragAllocTest(void *ptr) {
size_t size = zmalloc_usable_size(ptr);
void *newptr = zmalloc(size);
memcpy(newptr, ptr, size);
zfree(ptr);