[PATCH] test-skeleton.c (xrealloc): Support realloc-as-free

Florian Weimer fweimer@redhat.com
Thu Jun 23 12:54:00 GMT 2016


On 06/23/2016 02:45 PM, Mike Frysinger wrote:
> On 23 Jun 2016 14:23, Florian Weimer wrote:
>> If the requested size is zero, realloc returns NULL, but the
>> deallocation is still successful.
>
> not exactly.  realloc(NULL, 0) will return a valid pointer (much
> like malloc(NULL) will).  code relies on this to generate cookies.

Ugh, right.  At least our malloc behaves in this way.  What about the 
attached patch?

Thanks,
Florian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xrealloc.patch
Type: text/x-patch
Size: 802 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160623/66393f00/attachment.bin>


More information about the Libc-alpha mailing list