Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 26 Apr 2001 13:46:43 +0000 (13:46 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 26 Apr 2001 13:46:43 +0000 (13:46 +0000)
* malloc/mcheck.c (mcheck): Call malloc once before setting the
hooks to allow the internal check hooks to be set up if necessary.

ChangeLog
malloc/mcheck.c

index 08ecaab..f16b9d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-04-26  Ulrich Drepper  <drepper@redhat.com>
 
+       * malloc/mcheck.c (mcheck): Call malloc once before setting the
+       hooks to allow the internal check hooks to be set up if necessary.
+
        * nis/nss-nis.h: Move yperr2nss_tab definition into separate file
        and rename to __yperr2nss_tab.  Change YPERR_COUNT into variable
        __yperr2nss_count.
index f17bc0c..971e2e5 100644 (file)
@@ -315,6 +315,10 @@ mcheck (func)
   /* These hooks may not be safely inserted if malloc is already in use.  */
   if (__malloc_initialized <= 0 && !mcheck_used)
     {
+      /* We call malloc() once here to ensure it is initialized.  */
+      void *p = malloc (0);
+      free (p);
+
       old_free_hook = __free_hook;
       __free_hook = freehook;
       old_malloc_hook = __malloc_hook;