]> git.kaiwu.me - njs.git/commitdiff
Modules: fixed variable name cleanup
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 22 May 2026 04:02:32 +0000 (21:02 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 26 May 2026 21:45:24 +0000 (14:45 -0700)
nginx/ngx_http_js_module.c
nginx/ngx_stream_js_module.c

index 2412bbc0759613af73a9a88cf5f9f7f94ecc8e79..447ead13432eb11568cd517629b63f83e70f6365 100644 (file)
@@ -8153,6 +8153,7 @@ ngx_http_qjs_variables_own_property(JSContext *cx, JSPropertyDescriptor *pdesc,
     } else {
         name_lc.data = ngx_pnalloc(r->pool, name.len);
         if (name_lc.data == NULL) {
+            JS_FreeCString(cx, (char *) name.data);
             (void) JS_ThrowOutOfMemory(cx);
             return -1;
         }
@@ -8214,6 +8215,7 @@ ngx_http_qjs_variables_set_property(JSContext *cx, JSValueConst obj,
     } else {
         lowcase_key = ngx_pnalloc(r->pool, name.len);
         if (lowcase_key == NULL) {
+            JS_FreeCString(cx, (char *) name.data);
             (void) JS_ThrowOutOfMemory(cx);
             return -1;
         }
index 096b96cb39d40e81863e06c13b8e81fd28e0e26c..0662ea5d360da9702eaa7bd6f3f76c8a1c5b99d0 100644 (file)
@@ -2759,6 +2759,7 @@ ngx_stream_qjs_variables_own_property(JSContext *cx,
     } else {
         name_lc.data = ngx_pnalloc(s->connection->pool, name.len);
         if (name_lc.data == NULL) {
+            JS_FreeCString(cx, (char *) name.data);
             (void) JS_ThrowOutOfMemory(cx);
             return -1;
         }
@@ -2819,6 +2820,7 @@ ngx_stream_qjs_variables_set_property(JSContext *cx, JSValueConst obj,
     } else {
         name_lc.data = ngx_pnalloc(s->connection->pool, name.len);
         if (name_lc.data == NULL) {
+            JS_FreeCString(cx, (char *) name.data);
             (void) JS_ThrowOutOfMemory(cx);
             return -1;
         }