From: Maxim Dounin Date: Wed, 30 Apr 2014 15:16:49 +0000 (+0400) Subject: Core: improved ngx_conf_parse() error handling. X-Git-Tag: release-1.7.1~30 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=aa28897b22f1e5f6c2345545099bf815232b6a7b;p=nginx.git 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). --- 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;