From: Maxim Dounin Date: Mon, 18 Jun 2012 14:10:50 +0000 (+0000) Subject: Fixed segfault with poll and resolver used. X-Git-Tag: release-1.3.2~12 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=a769c530ff587705754469c01c41688a995a12ce;p=nginx.git Fixed segfault with poll and resolver used. Poll event method needs ngx_cycle->files to work, and use of ngx_exit_cycle without files set caused null pointer dereference in resolver's cleanup on udp socket close. --- diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index 82cf8e6ca..0474a26ca 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -711,6 +711,8 @@ ngx_master_process_exit(ngx_cycle_t *cycle) ngx_exit_log.file = &ngx_exit_log_file; ngx_exit_cycle.log = &ngx_exit_log; + ngx_exit_cycle.files = ngx_cycle->files; + ngx_exit_cycle.files_n = ngx_cycle->files_n; ngx_cycle = &ngx_exit_cycle; ngx_destroy_pool(cycle->pool); @@ -1054,6 +1056,8 @@ ngx_worker_process_exit(ngx_cycle_t *cycle) ngx_exit_log.file = &ngx_exit_log_file; ngx_exit_cycle.log = &ngx_exit_log; + ngx_exit_cycle.files = ngx_cycle->files; + ngx_exit_cycle.files_n = ngx_cycle->files_n; ngx_cycle = &ngx_exit_cycle; ngx_destroy_pool(cycle->pool);