Skip to content

Commit

Permalink
fix memory leak in ACLMergeSelectorArguments
Browse files Browse the repository at this point in the history
  • Loading branch information
soloestoy committed Aug 1, 2023
1 parent 6abb3c4 commit b468d56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,8 @@ sds *ACLMergeSelectorArguments(sds *argv, int argc, int *merged_argc, int *inval
for (int j = 0; j < argc; j++) {
char *op = argv[j];

if (op[0] == '(' && op[sdslen(op) - 1] != ')') {
if (open_bracket_start == -1 &&
(op[0] == '(' && op[sdslen(op) - 1] != ')')) {
selector = sdsdup(argv[j]);
open_bracket_start = j;
continue;
Expand Down

0 comments on commit b468d56

Please sign in to comment.