mirror of
https://github.com/nginx/nginx.git
synced 2024-12-13 19:19:00 +08:00
restore environ, this fixes segfault on reconfiguration failure when
perl module creates new environment
This commit is contained in:
parent
2d95c3f210
commit
15c149e499
@ -255,11 +255,13 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ngx_conf_param(&conf) != NGX_CONF_OK) {
|
if (ngx_conf_param(&conf) != NGX_CONF_OK) {
|
||||||
|
environ = senv;
|
||||||
ngx_destroy_cycle_pools(&conf);
|
ngx_destroy_cycle_pools(&conf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) {
|
if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) {
|
||||||
|
environ = senv;
|
||||||
ngx_destroy_cycle_pools(&conf);
|
ngx_destroy_cycle_pools(&conf);
|
||||||
return NULL;
|
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])
|
if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index])
|
||||||
== NGX_CONF_ERROR)
|
== NGX_CONF_ERROR)
|
||||||
{
|
{
|
||||||
|
environ = senv;
|
||||||
ngx_destroy_cycle_pools(&conf);
|
ngx_destroy_cycle_pools(&conf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user