diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-02-22 22:13:18 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-02-22 22:13:18 +0000 |
commit | 551a8b838dd0aec11f1a7553b070651ef7bd1a24 (patch) | |
tree | bc15756c9e48e49b75b250fc1835605fb8c2c111 /perl.c | |
parent | 1fd3532f9ed8ec7839f29d416bafc4721424c1d9 (diff) | |
download | perl-551a8b838dd0aec11f1a7553b070651ef7bd1a24.tar.gz |
If we have a duplicated environment free it
if PERL_DESTRUCT_LEVEL.
p4raw-id: //depot/perl@8896
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -438,6 +438,20 @@ perl_destruct(pTHXx) return; } + /* jettison our possibly duplicated environment */ + +#ifdef USE_ENVIRON_ARRAY + if (environ != PL_origenviron) { + I32 i; + + for (i = 0; environ[i]; i++) + Safefree(environ[i]); + Safefree(environ); + + environ = PL_origenviron; + } +#endif + /* loosen bonds of global variables */ if(PL_rsfp) { |