aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schwab1999-02-28 02:12:07 +0000
committerAndreas Schwab1999-02-28 02:12:07 +0000
commitd942e12a70d6ac540eb621cf92de29f1c6a47958 (patch)
treec0fa33fe78ae09e4c0d728881bce44c44c078cde /src
parentfcdc4d6764666148f9e6e4fcf37c8fac5d709be4 (diff)
downloademacs-d942e12a70d6ac540eb621cf92de29f1c6a47958.tar.gz
emacs-d942e12a70d6ac540eb621cf92de29f1c6a47958.zip
(main) [DOUG_LEA_MALLOC]: Don't use unsetenv, it calls
malloc in glibc 2.1.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 956abe97b86..667b1db267b 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -571,8 +571,19 @@ main (argc, argv, envp)
571 if (!malloc_using_checking) 571 if (!malloc_using_checking)
572 /* Work around a bug in glibc's malloc. MALLOC_CHECK_ must be 572 /* Work around a bug in glibc's malloc. MALLOC_CHECK_ must be
573 ignored if the heap to be restored was constructed without 573 ignored if the heap to be restored was constructed without
574 malloc checking. */ 574 malloc checking. Can't use unsetenv, since that calls malloc. */
575 unsetenv ("MALLOC_CHECK_"); 575 {
576 char **p;
577
578 for (p = envp; *p; p++)
579 if (strncmp (*p, "MALLOC_CHECK_=", 14) == 0)
580 {
581 do
582 *p = p[1];
583 while (*++p);
584 break;
585 }
586 }
576 malloc_set_state (malloc_state_ptr); 587 malloc_set_state (malloc_state_ptr);
577 free (malloc_state_ptr); 588 free (malloc_state_ptr);
578 } 589 }