commit ba65fcd80f8296b96641b7f47c45d1ee989527ec
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Mon Oct 5 21:24:29 2026 +0200
Fix memory leak when policy parsing stops before append
diff --git a/MagickCore/policy.c b/MagickCore/policy.c
index b183a3cde..5bcb08511 100644
--- a/MagickCore/policy.c
+++ b/MagickCore/policy.c
@@ -1302,6 +1302,8 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,
break;
}
}
+ if (policy_info != (PolicyInfo *) NULL)
+ (void) DestroyPolicyElement(policy_info);
token=(char *) RelinquishMagickMemory(token);
return(status);
}