This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: malloc(0)
- To: Zack Weinberg <zack@rabi.phys.columbia.edu>
- Subject: Re: malloc(0)
- From: Roland McGrath <roland@frob.com>
- Date: Mon, 1 Jun 1998 14:23:04 -0400
- Cc: libc-hacker@cygnus.com
> I was thinking that (a) it would flush out bugs, and (b) a program written
> to assume that realloc(ptr, 0) is equivalent to free(ptr) would leak memory:
> small quantities, but potentially significant.
Ours is not the only system with this behavior, so programs with such
problems have them regardless and will be fixed if anyone cares.
> If it's one of those things that is near-impossible to change because it
> would break everything, then nevermind.
It is probably a small number of programs that would break. But without a
much more compelling motivation, we don't go making changes that we expect
to break any programs at all.