From 531647bb1bfb4ce02b691605e11ff4144396442b Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 10 Apr 2017 13:17:05 +0200 Subject: [PATCH] Make more obvious why there was issue #3843. --- src/module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/module.c b/src/module.c index b4da7f63..c81330b6 100644 --- a/src/module.c +++ b/src/module.c @@ -3236,6 +3236,9 @@ void moduleHandleBlockedClients(void) { if (bc->privdata && bc->free_privdata) bc->free_privdata(bc->privdata); if (c != NULL) unblockClient(c); + /* Free 'bc' only after unblocking the client, since it is + * referenced in the client blocking context, and must be valid + * when calling unblockClient(). */ zfree(bc); /* Lock again before to iterate the loop. */