[Andrew Pimlott <pimlott@abel.MATH.HARVARD.EDU>] realloc(p, 0) vs. free

Roland McGrath roland@frob.com
Wed Apr 28 10:43:00 GMT 1999


There is no question about this.  That is clearly a bug (and a relatively
recently introduced one).  ANSI C requires that realloc(ptr,0) == free(ptr).

The only thing that is optional is whether malloc(0) returns null or
a block that can be freed.



More information about the Libc-alpha mailing list