changeset 3142:959fa3a11b03

restore environ, this fixes segfault on reconfiguration failure when perl module creates new environment
author Igor Sysoev <igor@sysoev.ru>
date Fri, 18 Sep 2009 09:21:14 +0000
parents cbee9c114504
children ab6258e18099
files src/core/ngx_cycle.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_cycle.c	Fri Sep 18 09:12:40 2009 +0000
+++ b/src/core/ngx_cycle.c	Fri Sep 18 09:21:14 2009 +0000
@@ -255,11 +255,13 @@
 #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 @@
             if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index])
                 == NGX_CONF_ERROR)
             {
+                environ = senv;
                 ngx_destroy_cycle_pools(&conf);
                 return NULL;
             }