diff options
author | Ulrich Drepper <drepper@redhat.com> | 2007-05-19 04:26:03 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2007-05-19 04:26:03 +0000 |
commit | 129abdd3ee8f6388dbf8d786fd243d0560458905 (patch) | |
tree | 41c752bb8e50cac53e9a1e09afe927fad92b7e15 | |
parent | eb4b098a99573c186e1c0beaec29aeab033e7769 (diff) | |
download | glibc-129abdd3ee8f6388dbf8d786fd243d0560458905.tar.gz glibc-129abdd3ee8f6388dbf8d786fd243d0560458905.tar.xz glibc-129abdd3ee8f6388dbf8d786fd243d0560458905.zip |
* malloc/mcheck.c (reallochook): If size==0, free the block.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | malloc/mcheck.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 926e321aff..d5e1de39cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2007-05-18 Ulrich Drepper <drepper@redhat.com> + * malloc/mcheck.c (reallochook): If size==0, free the block. + * rt/tst-shm.c: Use fstat64 instead of fstat. * sysdeps/unix/sysv/linux/i386/sync_file_range.S: Fix case where diff --git a/malloc/mcheck.c b/malloc/mcheck.c index 02379d219d..4e0d4b5b7d 100644 --- a/malloc/mcheck.c +++ b/malloc/mcheck.c @@ -1,5 +1,5 @@ /* Standard debugging hooks for `malloc'. - Copyright (C) 1990-1997,99,2000,01,02 Free Software Foundation, Inc. + Copyright (C) 1990-1997,1999,2000-2002,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Written May 1989 by Mike Haertel. @@ -264,6 +264,12 @@ memalignhook (__malloc_size_t alignment, __malloc_size_t size, static __ptr_t reallochook (__ptr_t ptr, __malloc_size_t size, const __ptr_t caller) { + if (size == 0) + { + freehook (ptr, caller); + return; + } + struct hdr *hdr; __malloc_size_t osize; |