https://sourceware.org/bugzilla/show_bug.cgi?id=27797
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
I didn't see this patch on the mailing list, so I didn't reply there.
I think what realloc does when passed a 0 size is implementation-defined.
It may call free, but it may not. So, I think some other change is
needed, because with the current code you either get a double free
or a memory leak, depending on the underlying malloc implementation.
One simple thing to do would be like "if (size == 0) size = 1"
to avoid the problem entirely.
--
You are receiving this mail because:
You are on the CC list for the bug.