From d1a40539539883c56203743c16731734d2ad72fe Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 25 Apr 2012 11:25:44 +0200 Subject: [PATCH] jscript: Fixed func->funcs leak. --- dlls/jscript/compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 5d162eae443..8bb397d9e3f 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1812,9 +1812,10 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source, func->expr = func_expr; - func->funcs = heap_alloc_zero(func->func_cnt * sizeof(*func->funcs)); + func->funcs = compiler_alloc(ctx->code, func->func_cnt * sizeof(*func->funcs)); if(!func->funcs) return E_OUTOFMEMORY; + memset(func->funcs, 0, func->func_cnt * sizeof(*func->funcs)); for(iter = source->functions, i=0; iter; iter = iter->next, i++) { hres = compile_function(ctx, iter->expr->source_elements, iter->expr, FALSE, func->funcs+i);