aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream/ngx_stream_handler.c')
-rw-r--r--src/stream/ngx_stream_handler.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/stream/ngx_stream_handler.c b/src/stream/ngx_stream_handler.c
index aa69e4400..61169e1d0 100644
--- a/src/stream/ngx_stream_handler.c
+++ b/src/stream/ngx_stream_handler.c
@@ -149,6 +149,15 @@ ngx_stream_init_connection(ngx_connection_t *c)
cmcf = ngx_stream_get_module_main_conf(s, ngx_stream_core_module);
+ s->variables = ngx_pcalloc(s->connection->pool,
+ cmcf->variables.nelts
+ * sizeof(ngx_stream_variable_value_t));
+
+ if (s->variables == NULL) {
+ ngx_stream_close_connection(c);
+ return;
+ }
+
if (cmcf->limit_conn_handler) {
rc = cmcf->limit_conn_handler(s);