Fix memleak of SFLUSH experimental command (#13766)

On flushallSyncBgDone, if client doesn't exists, take care release
sflush struct.
This commit is contained in:
Moti Cohen
2025-01-30 13:35:02 +02:00
committed by GitHub
parent f5e046a730
commit 2bfffe85e9

View File

@@ -794,7 +794,10 @@ void flushallSyncBgDone(uint64_t client_id, void *sflush) {
client *c = lookupClientByID(client_id);
/* Verify that client still exists */
if (!c) return;
if (!c) {
zfree(sflush);
return;
}
/* Update current_client (Called functions might rely on it) */
client *old_client = server.current_client;