diff options
author | antirez <antirez@gmail.com> | 2019-02-07 16:20:42 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-02-07 16:20:49 +0100 |
commit | 7a86ba22e001d0b46bff9bf62f5c762471fd53ec (patch) | |
tree | 42587ae8a7eefe67de2b8f371af3c9a2d42492d7 | |
parent | 1790be1496d14efd6af65c8df2271e0b112740cb (diff) | |
download | redis-7a86ba22e001d0b46bff9bf62f5c762471fd53ec.tar.gz |
ACL: fix a few ACLLoadFromFile() errors and finish ACLFreeUsersSet().
-rw-r--r-- | src/acl.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -249,7 +249,7 @@ void ACLCopyUser(user *dst, user *src) { /* Free all the users registered in the radix tree 'users' and free the * radix tree itself. */ void ACLFreeUsersSet(rax *users) { - /* TODO */ + raxFreeWithCallback(users,(void(*)(void*))ACLFreeUser); } /* Given a command ID, this function set by reference 'word' and 'bit' @@ -1208,7 +1208,8 @@ sds ACLLoadFromFile(const char *filename) { ACLCopyUser(DefaultUser,new); ACLFreeUser(new); raxInsert(Users,(unsigned char*)"default",7,DefaultUser,NULL); - + raxRemove(old_users,(unsigned char*)"default",7,NULL); + ACLFreeUsersSet(old_users); sdsfree(errors); return NULL; } else { |