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.
This commit is contained in:
antirez 2019-02-11 16:28:31 +01:00
parent 2ce96c0fa7
commit df346bca39

View File

@ -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