extern char* _acmdln; /* pointer to ascii command line */
#undef _environ
extern char** _environ; /* pointer to environment block */
+extern char** __initenv; /* pointer to initial environment block */
/* LIBRARY GLOBAL VARIABLES ***************************************************/
/* destroy heap */
if (nAttachCount == 0)
{
-
+ if (__initenv && __initenv != _environ)
+ {
+ free(__initenv);
+ __initenv = NULL;
+ }
if (_environ)
{
FreeEnvironmentStringsA(_environ[0]);