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
7a86ba22
Commit
7a86ba22
authored
Feb 07, 2019
by
antirez
Browse files
ACL: fix a few ACLLoadFromFile() errors and finish ACLFreeUsersSet().
parent
1790be14
Changes
1
Show whitespace changes
Inline
Side-by-side
src/acl.c
View file @
7a86ba22
...
@@ -249,7 +249,7 @@ void ACLCopyUser(user *dst, user *src) {
...
@@ -249,7 +249,7 @@ void ACLCopyUser(user *dst, user *src) {
/* Free all the users registered in the radix tree 'users' and free the
/* Free all the users registered in the radix tree 'users' and free the
* radix tree itself. */
* radix tree itself. */
void
ACLFreeUsersSet
(
rax
*
users
)
{
void
ACLFreeUsersSet
(
rax
*
users
)
{
/* TODO */
raxFreeWithCallback
(
users
,(
void
(
*
)(
void
*
))
ACLFreeUser
);
}
}
/* Given a command ID, this function set by reference 'word' and 'bit'
/* Given a command ID, this function set by reference 'word' and 'bit'
...
@@ -1208,7 +1208,8 @@ sds ACLLoadFromFile(const char *filename) {
...
@@ -1208,7 +1208,8 @@ sds ACLLoadFromFile(const char *filename) {
ACLCopyUser
(
DefaultUser
,
new
);
ACLCopyUser
(
DefaultUser
,
new
);
ACLFreeUser
(
new
);
ACLFreeUser
(
new
);
raxInsert
(
Users
,(
unsigned
char
*
)
"default"
,
7
,
DefaultUser
,
NULL
);
raxInsert
(
Users
,(
unsigned
char
*
)
"default"
,
7
,
DefaultUser
,
NULL
);
raxRemove
(
old_users
,(
unsigned
char
*
)
"default"
,
7
,
NULL
);
ACLFreeUsersSet
(
old_users
);
sdsfree
(
errors
);
sdsfree
(
errors
);
return
NULL
;
return
NULL
;
}
else
{
}
else
{
...
...
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