1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

mtrace: properly handle realloc (p, 0)

This commit is contained in:
Andreas Schwab
2012-12-22 17:24:44 +01:00
parent 4056f4a03a
commit 2f5f40f465
2 changed files with 13 additions and 2 deletions

View File

@@ -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