From: Dmitry Volyntsev Date: Fri, 30 Oct 2026 01:40:09 +0000 (-0700) Subject: QuickJS: fix fs callback return value leak X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=592ee994670c6a3ca5db280cc3db7d20a9ccb83a;p=njs.git QuickJS: fix fs callback return value leak Previously, the value returned by a callback passed to the callback flavor of fs functions was never freed. The value stayed referenced until the runtime was freed, triggering the "list_empty(&rt->gc_obj_list)" assertion in JS_FreeRuntime() in debug builds and accumulating in the runtime with js_context_reuse. The issue was introduced in 1f8f9992 (0.8.9). --- diff --git a/external/qjs_fs_module.c b/external/qjs_fs_module.c index 059b46eb..42db4ff0 100644 --- a/external/qjs_fs_module.c +++ b/external/qjs_fs_module.c @@ -2737,6 +2737,8 @@ qjs_fs_result(JSContext *cx, JSValue result, int calltype, JSValue callback) return JS_EXCEPTION; } + JS_FreeValue(cx, promise); + return JS_UNDEFINED; default: