Mercurial > hg > nginx
comparison src/core/ngx_conf_file.c @ 2338:5cbf2da3a324
fix segfault on close error
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 25 Nov 2008 14:45:44 +0000 |
parents | 81d506883bba |
children | 2142237f66da |
comparison
equal
deleted
inserted
replaced
2337:3983e673cd40 | 2338:5cbf2da3a324 |
---|---|
256 done: | 256 done: |
257 | 257 |
258 if (filename) { | 258 if (filename) { |
259 ngx_free(cf->conf_file->buffer->start); | 259 ngx_free(cf->conf_file->buffer->start); |
260 | 260 |
261 cf->conf_file = prev; | |
262 | |
263 if (ngx_close_file(fd) == NGX_FILE_ERROR) { | 261 if (ngx_close_file(fd) == NGX_FILE_ERROR) { |
264 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, | 262 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, |
265 ngx_close_file_n " %s failed", | 263 ngx_close_file_n " %s failed", |
266 cf->conf_file->file.name.data); | 264 cf->conf_file->file.name.data); |
267 return NGX_CONF_ERROR; | 265 return NGX_CONF_ERROR; |
268 } | 266 } |
267 | |
268 cf->conf_file = prev; | |
269 } | 269 } |
270 | 270 |
271 if (rc == NGX_ERROR) { | 271 if (rc == NGX_ERROR) { |
272 return NGX_CONF_ERROR; | 272 return NGX_CONF_ERROR; |
273 } | 273 } |