[Samba] Possible memory leaks on lookup_sids()?

Jeremy Allison jra at samba.org
Sat Oct 27 01:05:15 GMT 2007


On Fri, Oct 26, 2007 at 06:01:53PM -0700, Jeremy Allison wrote:
> On Fri, Oct 26, 2007 at 09:40:18AM +0200, Volker Lendecke wrote:
> > On Mon, Oct 22, 2007 at 06:28:57PM -0400, simo wrote:
> > > Li, it seem indeed that we are not freeing the tmp_ctx at the end of the
> > > function, but I need some time to read that code in detail to make sure
> > > we are not returning some of that memory to the caller.
> > 
> > I think it is true. We need to free tmp_ctx before
> > returning. At least this is what it was designed for.
> 
> Yes - all memory returned is talloced off the dom_infos
> and name_infos variables as talloc contexts, which belong
> to the incoming mem_ctx ctx. All memory on the
> tmp_ctx can be thrown away at this point (although
> it will still be freed when mem_ctx is freed).

Pushed with git rev 25bbc9a6613bef0f3f73ecf634a38a9d56020f40
Jeremy.


More information about the samba-technical mailing list