diff --git a/src/acl.c b/src/acl.c index 5f418517..da7c0bd4 100644 --- a/src/acl.c +++ b/src/acl.c @@ -385,8 +385,13 @@ void ACLResetSubcommandsForCommand(user *u, unsigned long id) { * for the user. */ void ACLResetSubcommands(user *u) { if (u->allowed_subcommands == NULL) return; - for (int j = 0; j < USER_COMMAND_BITS_COUNT; j++) - if (u->allowed_subcommands[j]) zfree(u->allowed_subcommands[j]); + for (int j = 0; j < USER_COMMAND_BITS_COUNT; j++) { + if (u->allowed_subcommands[j]) { + for (int i = 0; u->allowed_subcommands[j][i]; i++) + sdsfree(u->allowed_subcommands[j][i]); + zfree(u->allowed_subcommands[j]); + } + } zfree(u->allowed_subcommands); u->allowed_subcommands = NULL; }