Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-04-30 19:16:49 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-04-30 19:16:49 +0400
commitaa28897b22f1e5f6c2345545099bf815232b6a7b (patch)
tree2f1091c38950d205546f1cc727b4a14b865b259d /src/core/ngx_conf_file.c
parent60169aa3a1d2372c3806ad239d65a992d5230edb (diff)
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.c2
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;