aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_cycle.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-09-18 09:21:14 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-09-18 09:21:14 +0000
commit15c149e4998a4c2cb5c1a8b759d0fc626032a6c1 (patch)
treed041b4fcb0bd53b73564e3701797559e6a2acf9d /src/core/ngx_cycle.c
parent2d95c3f2105b6b23c6befb2486ff1a7ec5650e96 (diff)
downloadnginx-15c149e4998a4c2cb5c1a8b759d0fc626032a6c1.tar.gz
nginx-15c149e4998a4c2cb5c1a8b759d0fc626032a6c1.zip
restore environ, this fixes segfault on reconfiguration failure when
perl module creates new environment
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r--src/core/ngx_cycle.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 17673d082..cd9efbee7 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -255,11 +255,13 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
#endif
if (ngx_conf_param(&conf) != NGX_CONF_OK) {
+ environ = senv;
ngx_destroy_cycle_pools(&conf);
return NULL;
}
if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) {
+ environ = senv;
ngx_destroy_cycle_pools(&conf);
return NULL;
}
@@ -280,6 +282,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index])
== NGX_CONF_ERROR)
{
+ environ = senv;
ngx_destroy_cycle_pools(&conf);
return NULL;
}