changeset 2714:4dd1773990db

fix segfault on exit if no http section is defined in confguraiton, the bug has been introduced in r1947
author Igor Sysoev <igor@sysoev.ru>
date Wed, 15 Apr 2009 20:28:36 +0000
parents b4d8aef4a1ad
children a5845475a903
files src/http/modules/perl/ngx_http_perl_module.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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();
     }
 }