svn commit: samba r18436 - in branches/SAMBA_4_0/source/lib/ldb: common ldb_ildap ldb_sqlite3 ldb_tdb modules tools

Andrew Bartlett abartlet at samba.org
Wed Sep 13 01:50:44 GMT 2006


On Tue, 2006-09-12 at 21:28 -0400, simo wrote:
> On Wed, 2006-09-13 at 00:10 +0000, tridge at samba.org wrote:
> > Author: tridge
> > Date: 2006-09-13 00:10:38 +0000 (Wed, 13 Sep 2006)
> > New Revision: 18436
> > 
> > WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18436
> > 
> > Log:
> > 
> > converted ldb to use talloc_move() instead of talloc_steal() when
> > appropriate.
> > 
> > Note that I also removed the error checks that were being done on the
> > result of talloc_steal(). They are pointless as talloc_steal() doesn't
> > have any failure modes that wouldn't cause a segv anyway, and they
> > tend to clutter the code
> 
> 
> > Modified: branches/SAMBA_4_0/source/lib/ldb/modules/paged_results.c
> > ===================================================================
> > --- branches/SAMBA_4_0/source/lib/ldb/modules/paged_results.c	2006-09-13 00:05:07 UTC (rev 18435)
> > +++ branches/SAMBA_4_0/source/lib/ldb/modules/paged_results.c	2006-09-13 00:10:38 UTC (rev 18436)
> > @@ -190,10 +190,7 @@
> >  
> >  		ac->store->num_entries++;
> >  
> > -		ac->store->last->r = talloc_steal(ac->store->last, ares);
> > -		if (ac->store->last->r == NULL) {
> > -			goto error;
> > -		}
> > +		ac->store->last->r = talloc_move(ac->store->last, ares);
> >  		ac->store->last->next = NULL;
> >  	}
> 
> Tridge,
> is this really the right case?
> 
> I find the fact that talloc_move() is really a macro that transforms the
> second argument in a pointer to itself a bit deceiving.

I agree.  It should take a ** if it is going to modify the variable, and
at least then we can think that this makes no sense.

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.                  http://redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20060913/a7c9087c/attachment.bin


More information about the samba-technical mailing list