Skip to content

Commit

Permalink
Fix enforcer_acl_free logic
Browse files Browse the repository at this point in the history
The logic for this free function was inverted, causing a bug where acls couldn't be freed
through the API.
  • Loading branch information
jhiemstrawisc committed May 26, 2023
1 parent b899d00 commit 7afec24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scitokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ void enforcer_destroy(Enforcer enf) {

void enforcer_acl_free(Acl *acls) {
for (int idx = 0;
acls[idx].authz == nullptr && acls[idx].resource == nullptr; idx++) {
acls[idx].authz != nullptr || acls[idx].resource != nullptr; idx++) {
free(const_cast<char *>(acls[idx].authz));
free(const_cast<char *>(acls[idx].resource));
}
Expand Down

0 comments on commit 7afec24

Please sign in to comment.