[PATCH] Fix bug #11177 - no talloc stackframe at ../source3/libsmb/clifsinfo.c:444, leaking memory

Andrew Bartlett abartlet at samba.org
Mon Apr 13 23:28:53 MDT 2015


On Tue, 2015-04-14 at 07:08 +0200, Volker Lendecke wrote:
> On Tue, Apr 14, 2015 at 02:12:33PM +1200, Andrew Bartlett wrote:
> > On Thu, 2015-03-26 at 18:43 +0100, Michael Adam wrote:
> > > The patch looks good, pushing.
> > > 
> > > One comment:
> > > 
> > > Somehow it feels awkward that all those SMBC_foo_ctx
> > > functions should have to create a talloc stackframe
> > > even if they don't need one themselves, just so that
> > > functions later in the call chain can be lazy.
> > > Can't this be done in a central place?
> > > (Or have I lost it completely?)
> > 
> > This is perhaps the biggest (rational) reason why I dislike
> > talloc_tos(). 
> 
> It does not play really well with publically exposed APIs, right. But from
> my point of view it's a big benefit that our memory leaks in server code
> have almost completely vanished. We have to balance this value against
> the downside, as always.
> 
> If you can propose a better API that brings the same benefit, automatic
> cleanup of most memory together with the speed improvement due to the
> central talloc pool (yes, this is measurable!), I'm more than happy to
> review your patch!

Do we still get that when each function has a talloc_stackframe(), and
talloc_tos() is never called?  That is all I'm really looking for.

Andrew Bartlett

-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba






More information about the samba-technical mailing list