diff options
author | Valentin Bartenev <vbart@nginx.com> | 2013-08-06 19:58:40 +0400 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2013-08-06 19:58:40 +0400 |
commit | 3c5bd34771be032ef14e59f934058b3dce93588b (patch) | |
tree | a71e5b734bca4200959241d928410ba98f48070b /src/http/ngx_http_script.c | |
parent | 1b7bc342186ff0768c06419a134032adb2a536f8 (diff) | |
download | nginx-3c5bd34771be032ef14e59f934058b3dce93588b.tar.gz nginx-3c5bd34771be032ef14e59f934058b3dce93588b.zip |
Fixed memory leaks in the root and auth_basic_user_file directives.
If a relative path is set by variables, then the ngx_conf_full_name()
function was called while processing requests, which causes allocations
from the cycle pool.
A new function that takes pool as an argument was introduced.
Diffstat (limited to 'src/http/ngx_http_script.c')
-rw-r--r-- | src/http/ngx_http_script.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c index 54d019589..1da793b8f 100644 --- a/src/http/ngx_http_script.c +++ b/src/http/ngx_http_script.c @@ -1334,7 +1334,11 @@ ngx_http_script_full_name_code(ngx_http_script_engine_t *e) value.data = e->buf.data; value.len = e->pos - e->buf.data; - if (ngx_conf_full_name((ngx_cycle_t *) ngx_cycle, &value, code->conf_prefix) + if (ngx_get_full_name(e->request->pool, + code->conf_prefix + ? (ngx_str_t *) &ngx_cycle->conf_prefix: + (ngx_str_t *) &ngx_cycle->prefix, + &value) != NGX_OK) { e->ip = ngx_http_script_exit; |