From 7afec2425c8c3e0f2f35cc598123c5764d2b2030 Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Fri, 26 May 2023 12:28:38 +0000 Subject: [PATCH] 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. --- src/scitokens.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scitokens.cpp b/src/scitokens.cpp index 6c79ab8..f46f05c 100644 --- a/src/scitokens.cpp +++ b/src/scitokens.cpp @@ -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(acls[idx].authz)); free(const_cast(acls[idx].resource)); }