* environ.cc (environ_init): Don't free the new environment table after we've

just copied stuff to it.
This commit is contained in:
Christopher Faylor 2000-09-03 04:45:52 +00:00
parent b0e82b74fb
commit d8242040b8
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sun Sep 3 00:38:40 2000 Christopher Faylor <cgf@cygnus.com>
* environ.cc (environ_init): Don't free the new environment table after
we've just copied stuff to it.
Sun Sep 3 00:07:32 2000 Christopher Faylor <cgf@cygnus.com> Sun Sep 3 00:07:32 2000 Christopher Faylor <cgf@cygnus.com>
* Makefile.in: Add cygheap.o. * Makefile.in: Add cygheap.o.

View File

@ -19,6 +19,7 @@ details. */
#include "fhandler.h" #include "fhandler.h"
#include "path.h" #include "path.h"
#include "cygerrno.h" #include "cygerrno.h"
#include "cygheap.h"
extern BOOL allow_glob; extern BOOL allow_glob;
extern BOOL allow_ntea; extern BOOL allow_ntea;
@ -535,8 +536,9 @@ environ_init (char **envp)
{ {
sz = envsize (envp, 1); sz = envsize (envp, 1);
char **newenv = (char **) malloc (sz); char **newenv = (char **) malloc (sz);
envp = (char **) memcpy (newenv, envp, sz); memcpy (newenv, envp, sz);
cfree (envp); cfree (envp);
envp = newenv;
goto out; goto out;
} }