diff options
author | antirez <antirez@gmail.com> | 2019-04-08 18:08:37 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-04-08 18:08:37 +0200 |
commit | c24e32041b91ac32626e8d8eee1c062942e25f27 (patch) | |
tree | 45893fde38f000bb7248a92dd10478d47c48b9da /src/acl.c | |
parent | f8a9708aa705b6493ef63a82e42ed428997b817a (diff) | |
download | redis-c24e32041b91ac32626e8d8eee1c062942e25f27.tar.gz |
ACL: Fix memory leak in ACLResetSubcommandsForCommand().
This commit fixes bug reported at #5998. Thanks to @tomcat1102.
Diffstat (limited to 'src/acl.c')
-rw-r--r-- | src/acl.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -542,6 +542,8 @@ struct redisCommand *ACLLookupCommand(const char *name) { * and command ID. */ void ACLResetSubcommandsForCommand(user *u, unsigned long id) { if (u->allowed_subcommands && u->allowed_subcommands[id]) { + for (int i = 0; u->allowed_subcommands[id][i]; i++) + sdsfree(u->allowed_subcommands[id][i]); zfree(u->allowed_subcommands[id]); u->allowed_subcommands[id] = NULL; } |