From 760c0128a4ef787c8c8addb26894c072ba8b2eb1 Mon Sep 17 00:00:00 2001 From: Justin King Date: Wed, 22 Mar 2023 15:28:44 +0000 Subject: [PATCH] 8304683: Memory leak in WB_IsMethodCompatible Reviewed-by: thartmann --- src/hotspot/share/prims/whitebox.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index ec9ef2102c4..403da9e1d03 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -824,10 +824,9 @@ static bool is_excluded_for_compiler(AbstractCompiler* comp, methodHandle& mh) { return true; } DirectiveSet* directive = DirectivesStack::getMatchingDirective(mh, comp); - if (directive->ExcludeOption) { - return true; - } - return false; + bool exclude = directive->ExcludeOption; + DirectivesStack::release(directive); + return exclude; } static bool can_be_compiled_at_level(methodHandle& mh, jboolean is_osr, int level) {