Mercurial > hg > nginx
changeset 5681:56ad171c3dd1
Core: improved ngx_conf_parse() error handling.
Previous code failed to properly restore cf->conf_file in case of
ngx_close_file() errors, potentially resulting in double free of
cf->conf_file->buffer->start.
Found by Coverity (CID 1087507).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 30 Apr 2014 19:16:49 +0400 |
parents | dfb3c15bc851 |
children | 110b50657d77 |
files | src/core/ngx_conf_file.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_conf_file.c Wed Apr 30 19:16:40 2014 +0400 +++ b/src/core/ngx_conf_file.c Wed Apr 30 19:16:49 2014 +0400 @@ -266,7 +266,7 @@ ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, ngx_close_file_n " %s failed", filename->data); - return NGX_CONF_ERROR; + rc = NGX_ERROR; } cf->conf_file = prev;