aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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 }