]> git.kaiwu.me - nginx.git/commitdiff
restore environ, this fixes segfault on reconfiguration failure when
authorIgor Sysoev <igor@sysoev.ru>
Fri, 18 Sep 2009 09:21:14 +0000 (09:21 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 18 Sep 2009 09:21:14 +0000 (09:21 +0000)
perl module creates new environment

src/core/ngx_cycle.c

index 17673d08235903dbd2e4b12aa636f8118474c54c..cd9efbee7339467811a844a2711b6d37204ec524 100644 (file)
@@ -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;
             }