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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user