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.
This commit is contained in:
Maxim Dounin 2012-06-18 14:10:50 +00:00
parent c45bd10b1c
commit a769c530ff

View File

@ -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);