mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 13:43:28 -06:00
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:
parent
a11050ea4e
commit
f0fbcaf098
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user