[PATCH] Minor cleanup to libnet_join_member

Swen Schillig swen at vnet.ibm.com
Thu Jan 25 15:52:04 UTC 2018


On Thu, 2018-01-25 at 15:16 +0100, Volker Lendecke via samba-technical
wrote:
> On Thu, Jan 25, 2018 at 03:03:56PM +0100, Swen Schillig via samba-
> technical wrote:
> > On Thu, 2018-01-25 at 14:49 +0100, Volker Lendecke via samba-
> > technical
> > wrote:
> > > On Thu, Jan 25, 2018 at 02:33:12PM +0100, Swen Schillig via
> > > samba-
> > > technical wrote:
> > > > 
> > > 
> > > Bike-shedding-alert: talloc_move() is higly preferred over
> > > talloc_steal() these days...
> > > 
> > > Volker
> > 
> > I was thinking about it as well, but I didn't see the point to zero
> > the "old" variable just before destroying it anyway.
> 
> That's true. But TALLOC_FREE instead of talloc_free is overkill in
> many places too. It's just careful programming. We want to crash
> instead of use-after-free of pointers.
> 
> Volker

The data we're talking about is local, the processing is synchronous
and the very next command is free'in the memory.
Since talloc_move is not atomic, it is not any bit more secure here
then talloc_steal.

Anyhow, if there's no other opinion 'til tomorrow, 
I'll update the code for you to talloc_move :-)

Cheers Swen.




More information about the samba-technical mailing list