aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_process_cycle.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2012-06-18 14:10:50 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2012-06-18 14:10:50 +0000
commita769c530ff587705754469c01c41688a995a12ce (patch)
tree50e09eca026c7cb0a655fc00f0f16aa7a0731730 /src/os/unix/ngx_process_cycle.c
parentc45bd10b1c0b602446c68bcf3845d67737aedea2 (diff)
downloadnginx-a769c530ff587705754469c01c41688a995a12ce.tar.gz
nginx-a769c530ff587705754469c01c41688a995a12ce.zip
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.
Diffstat (limited to 'src/os/unix/ngx_process_cycle.c')
-rw-r--r--src/os/unix/ngx_process_cycle.c4
1 files changed, 4 insertions, 0 deletions
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);