[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Does malloc() have to zero the block?
- From: roberto@... (Roberto Ierusalimschy)
- Date: Wed, 19 Sep 2007 15:22:52 -0300
> It turns out that realloc() is the only library function that is
> called, and my implementation of realloc() calls malloc() if the
> pointer to the original data is NULL.
First you should check whether the new size is not zero. (malloc(0) does
allocate memory on some systems...)