svn commit: samba r14257 - in trunk/source/passdb: .

Jeremy Allison jra at samba.org
Mon Mar 13 00:18:34 GMT 2006


On Sun, Mar 12, 2006 at 07:12:03PM -0500, simo wrote:
> On Sun, 2006-03-12 at 15:48 -0800, Jeremy Allison wrote:
> > On Sun, Mar 12, 2006 at 11:09:32PM +0000, idra at samba.org wrote:
> > > Author: idra
> > > Date: 2006-03-12 23:09:31 +0000 (Sun, 12 Mar 2006)
> > > New Revision: 14257
> > > 
> > > WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14257
> > > 
> > > Log:
> > > 
> > > commit some fixes to the previous patch as Volker pointed out some flaws.
> > 
> > Still has problems. *Never* use talloc_free, always use TALLOC_FREE.
> > If you're using talloc_free you need to be re-examining your
> > patch.
> 
> no, the use of talloc_free() is ok because we are always sure the
> context passed is not null and valid.

It's a habit thing. If you *always* use TALLOC_FREE you'll have
less bugs than if you think you can get away with talloc_free
as 'it doesn't matter this time'. I just fixed an unbelievably
subtle bug where someone used a _free call instead of a _FREE
style call. No one visually inspecting the code would have (or
did) see it. Coverity found it.

I know it doesn't matter in this case, but using TALLOC_FREE
instead here doesn't hurt either, and so it's safe to just
always use TALLOC_FREE.

If I do a grep on the source and see talloc_free, instead
of TALLOC_FREE, I want it to be an exceptional case *only*
with a comment explaining why that was used.

Jeremy.


More information about the samba-technical mailing list