malloc (0)

Petri Helenius pete at rommon.com
Sat Feb 21 09:00:16 PST 2004


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 started complaining 
about zero sized allocations from get_addrselectpolicy.

Pete



More information about the freebsd-net mailing list