]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 30 Oct 2004 18:04:21 +0000 (18:04 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 30 Oct 2004 18:04:21 +0000 (18:04 +0000)
2004-10-30  Andreas Schwab  <schwab@suse.de>

* sysdeps/unix/sysv/linux/waitid.c: Include <stddef.h> for NULL.

2004-10-30  Ulrich Drepper  <drepper@redhat.com>

* malloc/malloc.c (_int_free): Use unique comments for the error
cases.

ChangeLog
malloc/malloc.c
sysdeps/unix/sysv/linux/waitid.c

index 5fcfdaeaba4232b43f15668420fac2fcda0723d6..fde483aac10f2ec0a32bdce50af7f7765e4f8613 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-30  Andreas Schwab  <schwab@suse.de>
+
+       * sysdeps/unix/sysv/linux/waitid.c: Include <stddef.h> for NULL.
+
+2004-10-30  Ulrich Drepper  <drepper@redhat.com>
+
+       * malloc/malloc.c (_int_free): Use unique comments for the error
+       cases.
+
 2004-10-28  Roland McGrath  <roland@frob.com>
 
        * sysdeps/mach/hurd/i386/tls.h (_hurd_tls_fork): Use i386_thread_state
index 2e91952a2698510f79219b17c1dd93259f5b9728..6d6294c6e6a8578ff1cd27fa214a6ca68dc0b37c 100644 (file)
@@ -4198,6 +4198,8 @@ _int_free(mstate av, Void_t* mem)
 
   /* free(0) has no effect */
   if (mem != 0) {
+    const char *errstr = NULL;
+
     p = mem2chunk(mem);
     size = chunksize(p);
 
@@ -4207,7 +4209,9 @@ _int_free(mstate av, Void_t* mem)
        here by accident or by "design" from some intruder.  */
     if (__builtin_expect ((uintptr_t) p > (uintptr_t) -size, 0))
       {
-       malloc_printerr (check_action, "free(): invalid pointer", mem);
+       errstr = "free(): invalid pointer";
+      errout:
+       malloc_printerr (check_action, errstr, mem);
        return;
       }
 
@@ -4235,9 +4239,8 @@ _int_free(mstate av, Void_t* mem)
         record we are going to add (i.e., double free).  */
       if (__builtin_expect (*fb == p, 0))
        {
-       double_free:
-         malloc_printerr (check_action, "double free or corruption", mem);
-         return;
+         errstr = "double free or corruption (fasttop)";
+         goto errout;
        }
       p->fd = *fb;
       *fb = p;
@@ -4253,15 +4256,24 @@ _int_free(mstate av, Void_t* mem)
       /* Lightweight tests: check whether the block is already the
         top block.  */
       if (__builtin_expect (p == av->top, 0))
-       goto double_free;
+       {
+         errstr = "double free or corruption (top)";
+         goto errout;
+       }
       /* Or whether the next chunk is beyond the boundaries of the arena.  */
       if (__builtin_expect (contiguous (av)
                            && (char *) nextchunk
                               >= ((char *) av->top + chunksize(av->top)), 0))
-       goto double_free;
+       {
+         errstr = "double free or corruption (out)";
+         goto errout;
+       }
       /* Or whether the block is actually not marked used.  */
       if (__builtin_expect (!prev_inuse(nextchunk), 0))
-       goto double_free;
+       {
+         errstr = "double free or corruption (!prev)";
+         goto errout;
+       }
 
       nextsize = chunksize(nextchunk);
       assert(nextsize > 0);
index 207c3d3453860c324cb9d592c40f495a76035eab..71d5d3aa10558394049130f29446dc71f99072cd 100644 (file)
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <stddef.h>
 #include <errno.h>
 #include <sys/wait.h>
 #include <kernel-features.h>