From 1dbba8a88eaa40d15a8a9b70bb1a0b8fb5b552e6 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Thu, 11 Dec 2025 19:18:56 +0100 Subject: [PATCH] removed use after free in js_create_module_bytecode_function() (#467) --- quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index af1bddf..3e88d7b 100644 --- a/quickjs.c +++ b/quickjs.c @@ -29957,6 +29957,7 @@ static int js_create_module_bytecode_function(JSContext *ctx, JSModuleDef *m) if (JS_IsException(func_obj)) return -1; + m->func_obj = func_obj; b = JS_VALUE_GET_PTR(bfunc); func_obj = js_closure2(ctx, func_obj, b, NULL, NULL, TRUE, m); if (JS_IsException(func_obj)) { @@ -29964,7 +29965,6 @@ static int js_create_module_bytecode_function(JSContext *ctx, JSModuleDef *m) JS_FreeValue(ctx, func_obj); return -1; } - m->func_obj = func_obj; return 0; }