diff options
Diffstat (limited to 'src/http/modules/ngx_http_rewrite_module.c')
-rw-r--r-- | src/http/modules/ngx_http_rewrite_module.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c index a5b96f8fd..41cfc2d97 100644 --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -567,15 +567,14 @@ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) clcf->name = pclcf->name; clcf->noname = 1; - if (pclcf->locations.elts == NULL) { - if (ngx_array_init(&pclcf->locations, cf->pool, 4, sizeof(void *)) - == NGX_ERROR) - { + if (pclcf->locations == NULL) { + pclcf->locations = ngx_array_create(cf->pool, 2, sizeof(void *)); + if (pclcf->locations == NULL) { return NGX_CONF_ERROR; } } - clcfp = ngx_array_push(&pclcf->locations); + clcfp = ngx_array_push(pclcf->locations); if (clcfp == NULL) { return NGX_CONF_ERROR; } |