From 38e66d80c8831e54561ccfc4d571db36d091cd33 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 18 Jul 2015 08:44:15 -0600 Subject: [PATCH] fix #447: leak in compile.cpp (thanks, @mretallack!) --- src/compile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compile.cpp b/src/compile.cpp index 18fc34b797..276481580c 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -7030,9 +7030,9 @@ void compile(MyThread* t, Context* context) c->restoreState(state); - ir::Type* stackMap = (ir::Type*)malloc( + ir::Type* stackMap2 = (ir::Type*)malloc( sizeof(ir::Type) * context->method->code()->maxStack()); - Frame frame2(&frame, stackMap); + Frame frame2(&frame, stackMap2); unsigned end = duplicatedBaseIp + exceptionHandlerEnd(eh); if (exceptionHandlerIp(eh) >= static_cast(start) @@ -7053,6 +7053,7 @@ void compile(MyThread* t, Context* context) context->eventLog.append(PopContextEvent); eventIndex = calculateFrameMaps(t, context, 0, eventIndex, 0); + free(stackMap2); } } }