News for hackers. Stuff that matters.
Re:A Story Of realloc (And Laziness) by prutschman on Sunday April 06, 2014 @03:33PM (#7542403)
In the context of the code presented all mallocs were returned by sbrk. Even if the previous malloc had been "allocated" with size zero, the sbrk called by this function's invocation of malloc will ensure that there are enough bytes of addressable memory to ensure that, although it will be copying data out of earlier allocations, it will not segfault. realloc makes no guarantees of zero-initializing a newly allocated extent.

There are no comments on this comment yet.