Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!ames!ucsd!usc!cs.utexas.edu!uunet!munnari.oz.au!metro!cluster!necisa!boyd From: boyd@necisa.ho.necisa.oz (Boyd Roberts) Newsgroups: comp.lang.c Subject: Re: free (NULL) Message-ID: <1747@necisa.ho.necisa.oz> Date: 4 Jun 90 00:21:41 GMT References: <1771@mindlink.UUCP> <2574@skye.ed.ac.uk> <1074:May3000:24:1990@stealth.acf.nyu.edu> <3102@goanna.cs.rmit.oz.au> <3466:May3022:56:1890@stealth.acf.nyu.edu> <9YT3MP@xds13.ferranti.com> <270:Jun113:33:1590@stealth.acf.nyu.edu> < Organization: NEC Information Systems Australia Pty. Ltd. Lines: 17 In article peter@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@necisa.ho.necisa.oz.au ``When the going gets wierd, the weird turn pro...''