Skip to content

Commit 7afec24

Browse files
committed
Fix enforcer_acl_free logic
The logic for this free function was inverted, causing a bug where acls couldn't be freed through the API.
1 parent b899d00 commit 7afec24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scitokens.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ void enforcer_destroy(Enforcer enf) {
554554

555555
void enforcer_acl_free(Acl *acls) {
556556
for (int idx = 0;
557-
acls[idx].authz == nullptr && acls[idx].resource == nullptr; idx++) {
557+
acls[idx].authz != nullptr || acls[idx].resource != nullptr; idx++) {
558558
free(const_cast<char *>(acls[idx].authz));
559559
free(const_cast<char *>(acls[idx].resource));
560560
}

0 commit comments

Comments
 (0)