diff options
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r-- | src/core/ngx_conf_file.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index 90a09d231..fb629a439 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -579,8 +579,18 @@ ngx_int_t ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name) name->len = cycle->root.len + old.len; - if (!(name->data = ngx_palloc(cycle->pool, name->len + 1))) { - return NGX_ERROR; + if (cycle->connections) { + if (!(name->data = ngx_palloc(cycle->pool, name->len + 1))) { + return NGX_ERROR; + } + + } else { + + /* the init_cycle */ + + if (!(name->data = ngx_alloc(name->len + 1, cycle->log))) { + return NGX_ERROR; + } } p = ngx_cpymem(name->data, cycle->root.data, cycle->root.len), |