free (NULL)

Boyd Roberts boyd at necisa.ho.necisa.oz
Mon Jun 4 10:21:41 AEST 1990


In article <WUU3BX6 at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
>
>He didn't make any hard-and-fast rule about never returning a malloc-ed
>chunk of memory to ones parent. Just make sure that the interface is
>properly documented and consistent.
>-- 

Correct.

Return what you like and define what the caller must do with the object when
the caller is finished with it.  Writing code that doesn't return objects
allocated on the fly can really get in the way of writing clean code.


Boyd Roberts			boyd at necisa.ho.necisa.oz.au

``When the going gets wierd, the weird turn pro...''



More information about the Comp.lang.c mailing list