mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
mtrace: properly handle realloc (p, 0)
This commit is contained in:
parent
4056f4a03a
commit
2f5f40f465
@ -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.
|
||||
|
@ -219,8 +219,13 @@ tr_reallochook (ptr, size, caller)
|
||||
|
||||
tr_where (caller, info);
|
||||
if (hdr == NULL)
|
||||
{
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user