Use ngx_pcalloc() in ngx_conf_merge_path_value().

It initializes the "data" pointer of ngx_path_t that will be checked after
subsequent changes.
This commit is contained in:
Valentin Bartenev 2013-09-16 18:49:10 +04:00
parent a11050ea4e
commit f0fbcaf098

View File

@ -402,7 +402,7 @@ ngx_conf_merge_path_value(ngx_conf_t *cf, ngx_path_t **path, ngx_path_t *prev,
return NGX_CONF_OK;
}
*path = ngx_palloc(cf->pool, sizeof(ngx_path_t));
*path = ngx_pcalloc(cf->pool, sizeof(ngx_path_t));
if (*path == NULL) {
return NGX_CONF_ERROR;
}
@ -421,10 +421,6 @@ ngx_conf_merge_path_value(ngx_conf_t *cf, ngx_path_t **path, ngx_path_t *prev,
+ init->level[1] + (init->level[1] ? 1 : 0)
+ init->level[2] + (init->level[2] ? 1 : 0);
(*path)->manager = NULL;
(*path)->loader = NULL;
(*path)->conf_file = NULL;
if (ngx_add_path(cf, path) != NGX_OK) {
return NGX_CONF_ERROR;
}