freeDictIfNeeded when kvstoreEmpty (#13098)

just like `kvstoreDictDelete`, we need check `freeDictIfNeeded` when
`kvstoreEmpty`.
This commit is contained in:
zhaozhao.zz 2024-02-29 14:16:41 +08:00 committed by GitHub
parent a7abc2f067
commit cc9fbd270e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -277,6 +277,7 @@ void kvstoreEmpty(kvstore *kvs, void(callback)(dict*)) {
if (metadata->rehashing_node)
metadata->rehashing_node = NULL;
dictEmpty(d, callback);
freeDictIfNeeded(kvs, didx);
}
listEmpty(kvs->rehashing);