mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Fix memleak of SFLUSH experimental command (#13766)
On flushallSyncBgDone, if client doesn't exists, take care release sflush struct.
This commit is contained in:
5
src/db.c
5
src/db.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user