From 3822a465f291864630e8f5e2c1af5862d9b94c01 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 11 Feb 2019 16:28:31 +0100 Subject: [PATCH] ACL: ACLFreeUserAndKillClients(): free user later. Soon or later we may have code in freeClient() that may have to deal with ACLs. Imagine for instance the command proposed multiple times (not sure if this will ever be accepted but still...): ONCLOSE DEL mykey Accumulating commands to run when a client is disconnected. Now the function is compatible with such use cases. Related to #5829. --- src/acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/acl.c b/src/acl.c index 13e6ac49a..7dc23f1c5 100644 --- a/src/acl.c +++ b/src/acl.c @@ -224,7 +224,6 @@ void ACLFreeUser(user *u) { * connections in order to kill all the pending ones that * are authenticated with such user. */ void ACLFreeUserAndKillClients(user *u) { - ACLFreeUser(u); listIter li; listNode *ln; listRewind(server.clients,&li); @@ -242,6 +241,7 @@ void ACLFreeUserAndKillClients(user *u) { freeClientAsync(c); } } + ACLFreeUser(u); } /* Copy the user ACL rules from the source user 'src' to the destination