Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
9db2c849
Commit
9db2c849
authored
Jan 30, 2019
by
antirez
Browse files
ACL: free memory leak when freeing subcommands array.
parent
36a0168c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
9db2c849
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment