1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-01 12:19:28 +00:00

In env_destroy(), it is a bad idea to env_swap(self, 0) to switch

back to the original environ unconditionally.  The setting of the
variable to save the previous environ is conditional; it happens when
ENV.e_committed is set.  Therefore, don't try to swap the env back
unless the previous env has been initialized.

PR:		bin/22670
Submitted by:	Takanori Saneto <sanewo@ba2.so-net.ne.jp>
This commit is contained in:
Brian Feldman 2000-11-25 02:00:35 +00:00
parent 2a644691bc
commit ee510eab3f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69130
2 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,8 @@ env_destroy(ENV *self)
{
struct env_entry *p;
if (self->e_committed)
env_swap(self, 0);
env_swap(self, 0);
SLIST_FOREACH(p, &self->e_head, ee_entries) {
free(p->ee_env);

View File

@ -176,6 +176,8 @@ env_destroy(ENV *self)
{
struct env_entry *p;
if (self->e_committed)
env_swap(self, 0);
env_swap(self, 0);
SLIST_FOREACH(p, &self->e_head, ee_entries) {
free(p->ee_env);