--- trunk/reactos/lib/msvcrt/misc/environ.c 2005-01-01 10:59:31 UTC (rev 12685)
+++ trunk/reactos/lib/msvcrt/misc/environ.c 2005-01-01 11:02:35 UTC (rev 12686)
@@ -1,4 +1,4 @@
-/* $Id: environ.c,v 1.12 2004/12/13 18:30:08 hbirr Exp $
+/* $Id$
*
* dllmain.c
*
@@ -56,7 +56,7 @@
count++;
}
- _environ = malloc(count * sizeof(char*));
+ __initenv = _environ = malloc(count * sizeof(char*));
if (_environ)
{
for (ptr = environment_strings, envptr = _environ; count > 1; ptr += len)
@@ -71,6 +71,7 @@
free(*envptr);
FreeEnvironmentStringsA(environment_strings);
free(_environ);
+ __initenv = _environ = NULL;
return -1;
}
memcpy(*envptr++, ptr, len);
@@ -106,7 +107,7 @@
count++;
}
- _wenviron = malloc(count * sizeof(wchar_t*));
+ __winitenv = _wenviron = malloc(count * sizeof(wchar_t*));
if (_wenviron)
{
for (ptr = environment_strings, envptr = _wenviron; count > 1; ptr += len)
@@ -121,6 +122,7 @@
free(*envptr);
FreeEnvironmentStringsW(environment_strings);
free(_wenviron);
+ __winitenv = _wenviron = NULL;
return -1;
}
memcpy(*envptr++, ptr, len * sizeof(wchar_t));