Re: malloc (0)

2004-02-21 Thread Petri Helenius
Maxime Henrion wrote: In C99, malloc(0) is legal. From n869.txt : %% If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not

Re: malloc (0)

2004-02-21 Thread Maxime Henrion
Petri Helenius wrote: > > I?m asking the net list because I came across this when browsing through > the networking / resolver code. > > The question is if the code should check for zero value before calling > malloc or is malloc(0) legal if the pointer is never used? >

malloc (0)

2004-02-21 Thread Petri Helenius
I´m asking the net list because I came across this when browsing through the networking / resolver code. The question is if the code should check for zero value before calling malloc or is malloc(0) legal if the pointer is never used? I came across this when using dmalloc library and it