diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2014-04-30 19:16:49 +0400 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2014-04-30 19:16:49 +0400 |
commit | aa28897b22f1e5f6c2345545099bf815232b6a7b (patch) | |
tree | 2f1091c38950d205546f1cc727b4a14b865b259d /src/core/ngx_conf_file.c | |
parent | 60169aa3a1d2372c3806ad239d65a992d5230edb (diff) | |
download | nginx-aa28897b22f1e5f6c2345545099bf815232b6a7b.tar.gz nginx-aa28897b22f1e5f6c2345545099bf815232b6a7b.zip |
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).
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r-- | src/core/ngx_conf_file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index f61bfcabf..d6b5cdf1e 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -266,7 +266,7 @@ done: 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; |