From: Dmitry Volyntsev Date: Wed, 3 Jun 2026 02:06:39 +0000 (-0700) Subject: Stream: fixed variable value state on allocation failure X-Git-Tag: 1.0.0~26 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/stylesheets/print.css?a=commitdiff_plain;h=78d4ea53331273e2729576afaf067544dcc67b49;p=njs.git Stream: fixed variable value state on allocation failure Reset the variable value validity flag when allocating storage for a stream variable fails. This matches the HTTP variable path and prevents a failed assignment from leaving a half-initialized value marked as valid. --- diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c index 0662ea5d..308ddfd1 100644 --- a/nginx/ngx_stream_js_module.c +++ b/nginx/ngx_stream_js_module.c @@ -1951,6 +1951,8 @@ ngx_stream_js_session_variables(njs_vm_t *vm, njs_object_prop_t *prop, vv->data = ngx_pnalloc(s->connection->pool, val.length); if (vv->data == NULL) { + vv->valid = 0; + njs_vm_memory_error(vm); return NJS_ERROR; }