[PATCH] Allow talloc reparenting in a destructor.
asn at samba.org
Tue Mar 10 03:43:25 MDT 2015
On Saturday 07 March 2015 08:17:34 Jeremy Allison wrote:
> On Thu, Mar 05, 2015 at 01:01:52PM -0800, Jeremy Allison wrote:
> > On Thu, Mar 05, 2015 at 05:41:06PM +0100, Volker Lendecke wrote:
> > > On Thu, Mar 05, 2015 at 08:38:08AM -0800, Jeremy Allison wrote:
> > > > Ah - picky compilers on our build machine :-).
> > > >
> > > > I need to explicitly ignore the return
> > > > from talloc_move() I think. Just added a (void).
> > >
> > > Re-pushed. Lets see how far we get this time.
> > New code exposed a bug inside smbd ! :-).
> > static int smbd_smb2_notify_smbreq_destructor(struct smb_request *smbreq)
> > was already trying to reparent a talloc'ed
> > object and return -1 to keep it around, and
> > we just got lucky that the thing it *actually*
> > got reparented to stayed around long enough.
> > In addition it found a bug calling talloc_set_destructor()
> > from inside an object destructor - any newly
> > set destructor was being overwritten by the old
> > one by talloc.
> > New fix for both issues, plus test modified
> > to test both problems attached.
> Ping ! Can I get a review on this one please ? It
> is fixing a genuine bug (memory leak in smbd_smb2_notify_smbreq_destructor).
> Once it's in master I'll log a bug and prepare back ports
> for 4.x.x.
I would prefer if you would log such a bug before this goes to master so that
the master commit also contains the bug number. This way if I search the patch
for a bug in 'git log' I will find it in newer versions ...
I makes life of people much easier who have to support Samba versions longer
that the upstream project does ...
Andreas Schneider GPG-ID: CC014E3D
Samba Team asn at samba.org
More information about the samba-technical