From: Dmitry Volyntsev Date: Thu, 11 Jun 2026 23:46:43 +0000 (-0700) Subject: QuickJS: fix promise and event leak on proxy URL evaluation failure X-Git-Tag: 1.0.0~15 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/stylesheets/print.css?a=commitdiff_plain;h=abd33656883cde9db4daa5a033d099d60c3380f4;p=njs.git QuickJS: fix promise and event leak on proxy URL evaluation failure Previously, when dynamic proxy URL evaluation failed in ngx_qjs_fetch(), the error was returned directly, bypassing the fail path which deletes the registered fetch event and releases the promise. The njs counterpart already goes through the fail path. As a side effect, the error is now reported by rejecting the returned promise instead of throwing synchronously, consistently with the other failure paths. --- diff --git a/nginx/ngx_qjs_fetch.c b/nginx/ngx_qjs_fetch.c index 1754f4eb..854deb52 100644 --- a/nginx/ngx_qjs_fetch.c +++ b/nginx/ngx_qjs_fetch.c @@ -346,7 +346,7 @@ ngx_qjs_ext_fetch(JSContext *cx, JSValueConst this_val, int argc, != NGX_OK) { JS_ThrowInternalError(cx, "failed to evaluate proxy URL"); - return JS_EXCEPTION; + goto fail; } } else {