aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/perl/ngx_http_perl_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-04-15 20:28:36 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-04-15 20:28:36 +0000
commite4ecddfdb0d2ffc872658e36028971ad9a873726 (patch)
treedeeb41a8ec3f53344bfb85ecf535fab23d861605 /src/http/modules/perl/ngx_http_perl_module.c
parentca878c8ccc38800b770c7fc7c24b1e97de42c640 (diff)
downloadnginx-e4ecddfdb0d2ffc872658e36028971ad9a873726.tar.gz
nginx-e4ecddfdb0d2ffc872658e36028971ad9a873726.zip
fix segfault on exit if no http section is defined in confguraiton,
the bug has been introduced in r1947
Diffstat (limited to 'src/http/modules/perl/ngx_http_perl_module.c')
-rw-r--r--src/http/modules/perl/ngx_http_perl_module.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
index 833e90f9d..a5462122b 100644
--- 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);
- {
-
- dTHXa(pmcf->perl);
- PERL_SET_CONTEXT(pmcf->perl);
-
- PERL_SYS_TERM();
+ if (pmcf) {
+ dTHXa(pmcf->perl);
+ PERL_SET_CONTEXT(pmcf->perl);
+ PERL_SYS_TERM();
}
}