This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.17-37-g2f5f40f


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  2f5f40f465c5c1af651727e756fd007fd11f2236 (commit)
      from  4056f4a03a524c94bdd02515e855043c8bb041d2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2f5f40f465c5c1af651727e756fd007fd11f2236

commit 2f5f40f465c5c1af651727e756fd007fd11f2236
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Sat Dec 22 17:24:44 2012 +0100

    mtrace: properly handle realloc (p, 0)

diff --git a/ChangeLog b/ChangeLog
index 8f46eba..2611e75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-03  Andreas Schwab  <schwab@linux-m68k.org>
+
+	[BZ #14981]
+	* malloc/mtrace.c (tr_reallochook): If realloc returns NULL when
+	size is zero, record memory as freed.
+
 2013-01-03  Andreas Jaeger  <aj@suse.de>
 
 	* po/ia.po: Add new Interlingua translation.
diff --git a/malloc/mtrace.c b/malloc/mtrace.c
index af3b7f8..e9ccfa2 100644
--- a/malloc/mtrace.c
+++ b/malloc/mtrace.c
@@ -219,8 +219,13 @@ tr_reallochook (ptr, size, caller)
 
   tr_where (caller, info);
   if (hdr == NULL)
-    /* Failed realloc.  */
-    fprintf (mallstream, "! %p %#lx\n", ptr, (unsigned long int) size);
+    {
+      if (size != 0)
+	/* Failed realloc.  */
+	fprintf (mallstream, "! %p %#lx\n", ptr, (unsigned long int) size);
+      else
+	fprintf (mallstream, "- %p\n", ptr);
+    }
   else if (ptr == NULL)
     fprintf (mallstream, "+ %p %#lx\n", hdr, (unsigned long int) size);
   else

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |    6 ++++++
 malloc/mtrace.c |    9 +++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]