svn commit: samba r16831 - in
branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .
simo
idra at samba.org
Thu Jul 6 13:22:30 GMT 2006
On Thu, 2006-07-06 at 22:58 +1000, Andrew Bartlett wrote:
> On Thu, 2006-07-06 at 08:17 -0400, simo wrote:
> > On Thu, 2006-07-06 at 06:04 +0000, abartlet at samba.org wrote:
> > > Author: abartlet
> > > Date: 2006-07-06 06:04:06 +0000 (Thu, 06 Jul 2006)
> > > New Revision: 16831
> > >
> > > WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16831
> > >
> > > Log:
> > > Use a valid memory context (found by the IBM checker).
> >
> > [...]
> >
> > > - ldb_set_errstring(module->ldb, talloc_asprintf(module, "samldb_notice_sid: error searching to see if sid %s is in use: %s\n",
> > > - dom_sid_string(dom_res, sid),
> > > + ldb_set_errstring(module->ldb, talloc_asprintf(mem_ctx, "samldb_notice_sid: error searching to see if sid %s is in use: %s\n",
> > > + dom_sid_string(mem_ctx, sid),
> >
> >
> > module is a valid memory context afaik, are you sure the IBM checker
> > understands talloc ?
>
> But dom_res is not (at this point it is uninitialised), and I figured
> mem_ctx was the correct place for the scratch memory (it is stolen by
> ldb_set_errstring()).
Actually ldb_set_errstring() steals the string not the mem_ctx, but the
mem_ctx will be later freed when finally the request will be freed after
we return the error back. Thanks.
Simo.
--
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org
More information about the samba-technical
mailing list