mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
ACL: free memory leak when freeing subcommands array.
This commit is contained in:
parent
36a0168cfd
commit
9db2c84984
@ -385,8 +385,13 @@ void ACLResetSubcommandsForCommand(user *u, unsigned long id) {
|
|||||||
* for the user. */
|
* for the user. */
|
||||||
void ACLResetSubcommands(user *u) {
|
void ACLResetSubcommands(user *u) {
|
||||||
if (u->allowed_subcommands == NULL) return;
|
if (u->allowed_subcommands == NULL) return;
|
||||||
for (int j = 0; j < USER_COMMAND_BITS_COUNT; j++)
|
for (int j = 0; j < USER_COMMAND_BITS_COUNT; j++) {
|
||||||
if (u->allowed_subcommands[j]) zfree(u->allowed_subcommands[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);
|
zfree(u->allowed_subcommands);
|
||||||
u->allowed_subcommands = NULL;
|
u->allowed_subcommands = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user