Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	* malloc/mcheck.c (mcheck): Call malloc once before setting the
	hooks to allow the internal check hooks to be set up if necessary.
  • Loading branch information
Ulrich Drepper committed Apr 26, 2001
1 parent 48a92e9 commit 1b20d93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 4 additions & 0 deletions malloc/mcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b20d93

Please sign in to comment.