Commit d942e12a authored by Andreas Schwab's avatar Andreas Schwab
Browse files

(main) [DOUG_LEA_MALLOC]: Don't use unsetenv, it calls

malloc in glibc 2.1.
parent fcdc4d67
......@@ -571,8 +571,19 @@ main (argc, argv, envp)
if (!malloc_using_checking)
/* Work around a bug in glibc's malloc. MALLOC_CHECK_ must be
ignored if the heap to be restored was constructed without
malloc checking. */
unsetenv ("MALLOC_CHECK_");
malloc checking. Can't use unsetenv, since that calls malloc. */
char **p;
for (p = envp; *p; p++)
if (strncmp (*p, "MALLOC_CHECK_=", 14) == 0)
*p = p[1];
while (*++p);
malloc_set_state (malloc_state_ptr);
free (malloc_state_ptr);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment