Re: Does malloc() have to zero the block?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Does malloc() have to zero the block?
- From: roberto@... (Roberto Ierusalimschy)
- Date: 2007年9月19日 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...)
-- Roberto