RE: [AD] fixes.. malloc()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Title: RE: [AD] fixes.. malloc()

> [snip - redundant 'free' checks]
> You are right, these should be removed. I find it's best not to check
> before calling free() because you could write the check the wrong way
> around and end up not freeing valid pointers, but only 0 pointers!

OTOH, I've never liked this rule, so I make a point of always
checking pointers, when they can be NULL. This looks like a wart
in the spec (which they unfortunately have brought to C++ delete).
Just to voice my point :)

--
Vincent Penquerc'h



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/