mirror of
https://github.com/nginx/nginx.git
synced 2025-06-16 00:21:02 +08:00
included file name must be allocated in pool,
because it may be used in error message later
This commit is contained in:
parent
5461caf920
commit
85d6a3e3db
@ -633,7 +633,7 @@ ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
{
|
{
|
||||||
char *rv;
|
char *rv;
|
||||||
ngx_int_t n;
|
ngx_int_t n;
|
||||||
ngx_str_t *value, file;
|
ngx_str_t *value, file, name;
|
||||||
ngx_glob_t gl;
|
ngx_glob_t gl;
|
||||||
|
|
||||||
value = cf->args->elts;
|
value = cf->args->elts;
|
||||||
@ -659,12 +659,15 @@ ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
rv = NGX_CONF_OK;
|
rv = NGX_CONF_OK;
|
||||||
|
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
n = ngx_read_glob(&gl, &file);
|
n = ngx_read_glob(&gl, &name);
|
||||||
|
|
||||||
if (n != NGX_OK) {
|
if (n != NGX_OK) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file.len = name.len++;
|
||||||
|
file.data = ngx_pstrdup(cf->pool, &name);
|
||||||
|
|
||||||
ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
|
ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
|
||||||
|
|
||||||
rv = ngx_conf_parse(cf, &file);
|
rv = ngx_conf_parse(cf, &file);
|
||||||
|
Loading…
Reference in New Issue
Block a user