]> git.kaiwu.me - nginx.git/commitdiff
fix segfault on exit if no http section is defined in confguraiton,
authorIgor Sysoev <igor@sysoev.ru>
Wed, 15 Apr 2009 20:28:36 +0000 (20:28 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 15 Apr 2009 20:28:36 +0000 (20:28 +0000)
the bug has been introduced in r1947

src/http/modules/perl/ngx_http_perl_module.c

index 833e90f9dc3a0398a95ad13bf6b65e7c08e402d5..a5462122b9b8051c75966849cf9e88053c3812a3 100644 (file)
@@ -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);
 
-    {
-
-    dTHXa(pmcf->perl);
-    PERL_SET_CONTEXT(pmcf->perl);
-
-    PERL_SYS_TERM();
+    if (pmcf) {
+        dTHXa(pmcf->perl);
+        PERL_SET_CONTEXT(pmcf->perl);
 
+        PERL_SYS_TERM();
     }
 }