# HG changeset patch # User Maxim Dounin # Date 1398871009 -14400 # Node ID 56ad171c3dd16534dba89eabfc54ac532ce8864d # Parent dfb3c15bc851374fbb1a521fc73bdb051a39b5f1 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 --- 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;