aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_js.c
diff options
context:
space:
mode:
Diffstat (limited to 'nginx/ngx_js.c')
-rw-r--r--nginx/ngx_js.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/nginx/ngx_js.c b/nginx/ngx_js.c
index 515218b9..01d4bb2a 100644
--- a/nginx/ngx_js.c
+++ b/nginx/ngx_js.c
@@ -31,12 +31,6 @@ typedef struct {
} ngx_js_rejected_promise_t;
-#if defined(PATH_MAX)
-#define NGX_MAX_PATH PATH_MAX
-#else
-#define NGX_MAX_PATH 4096
-#endif
-
typedef struct {
int fd;
njs_str_t name;
@@ -984,6 +978,11 @@ ngx_qjs_clone(ngx_js_ctx_t *ctx, ngx_js_loc_conf_t *cf, void *external)
"js load module exception: %V", &exception);
goto destroy;
}
+
+ if (i != length - 1) {
+ /* JS_EvalFunction() does JS_FreeValue(cx, rv) for the last rv. */
+ JS_FreeValue(cx, rv);
+ }
}
if (JS_ResolveModule(cx, rv) < 0) {