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:
parent
2a644691bc
commit
ee510eab3f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69130
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user