From 2bfffe85e9e8fc2eb5a107f86d40f4bb7830382b Mon Sep 17 00:00:00 2001 From: Moti Cohen Date: Thu, 30 Jan 2025 13:35:02 +0200 Subject: [PATCH] Fix memleak of SFLUSH experimental command (#13766) On flushallSyncBgDone, if client doesn't exists, take care release sflush struct. --- src/db.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/db.c b/src/db.c index d8eca59ff6..9a12291d8c 100644 --- a/src/db.c +++ b/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;