comparison src/http/ngx_http_core_module.c @ 5316:12dd27b74117

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.
author Valentin Bartenev <vbart@nginx.com>
date Tue, 06 Aug 2013 19:58:40 +0400
parents 8e7db77e5d88
children f1a91825730a
comparison
equal deleted inserted replaced
5315:31932b5464f0 5316:12dd27b74117
2014 == NULL) 2014 == NULL)
2015 { 2015 {
2016 return NULL; 2016 return NULL;
2017 } 2017 }
2018 2018
2019 if (ngx_conf_full_name((ngx_cycle_t *) ngx_cycle, path, 0) != NGX_OK) { 2019 if (ngx_get_full_name(r->pool, (ngx_str_t *) &ngx_cycle->prefix, path)
2020 != NGX_OK)
2021 {
2020 return NULL; 2022 return NULL;
2021 } 2023 }
2022 2024
2023 *root_length = path->len - reserved; 2025 *root_length = path->len - reserved;
2024 last = path->data + *root_length; 2026 last = path->data + *root_length;