summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/acl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/acl.c b/src/acl.c
index 0456e9f20..7aa7204f8 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -570,9 +570,12 @@ int ACLCheckCommandPerm(client *c) {
break;
}
}
- if (!match) return ACL_DENIED_KEY;
+ if (!match) {
+ getKeysFreeResult(keyidx);
+ return ACL_DENIED_KEY;
+ }
}
- getKeysFreeResult(keyidx);
+ if (keyidx) getKeysFreeResult(keyidx);
}
/* If we survived all the above checks, the user can execute the