# HG changeset patch # User Igor Sysoev # Date 1239827316 0 # Node ID 4dd1773990db35206f552f312e49eb806aa32c81 # Parent b4d8aef4a1adaa7f6f3f2daece86f253ff1eec0f fix segfault on exit if no http section is defined in confguraiton, the bug has been introduced in r1947 diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c --- a/src/http/modules/perl/ngx_http_perl_module.c +++ b/src/http/modules/perl/ngx_http_perl_module.c @@ -1061,12 +1061,10 @@ ngx_http_perl_exit(ngx_cycle_t *cycle) pmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_perl_module); - { + if (pmcf) { + dTHXa(pmcf->perl); + PERL_SET_CONTEXT(pmcf->perl); - dTHXa(pmcf->perl); - PERL_SET_CONTEXT(pmcf->perl); - - PERL_SYS_TERM(); - + PERL_SYS_TERM(); } }