s4:ldb_tdb - Rework/Various

simo idra at samba.org
Mon Oct 12 16:29:40 MDT 2009


On Tue, 2009-10-13 at 09:20 +1100, Andrew Bartlett wrote:
> On Mon, 2009-10-12 at 15:51 +0200, Matthias Dieter Wallnöfer wrote:
> > Hi Andrew,
> > 
> > well I don't like GOTOs as well. But I took a very diffused practice in 
> > s4 code (result/error handling goto). If you are very unhappy with the 
> > changed code I'll add additional cosmetics through a new patch which 
> > revert them partially.
> 
> For the cases where there really is no cleanup, I would like them
> reverted.  
> 
> For the cases where there is a trivial cleanup, perhaps talk to simo
> about how he would prefer it (he is the ldb maintainer after all), but
> my preference is to have a duplicated 'talloc_free(foo); return ret;'
> instead of a goto. 

When there is memory to free I actually prefer a goto, so that it is not
forgotten. But I wouldn't change existing code just to change it one way
or another unless there is an actual bug or you are already working on
the function for other reasons and changing it does not dilute the
readability of the patch wrt the primary change you are making.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list