[PATCH] Explain a bit of how loadparm works

Michael Adam obnox at samba.org
Wed Oct 16 02:27:55 MDT 2013


On 2013-10-16 at 09:00 +0200, Volker Lendecke wrote:
> On Wed, Oct 16, 2013 at 02:48:53PM +1300, Andrew Bartlett wrote:
> > On Tue, 2013-10-15 at 08:48 +0200, Stefan (metze) Metzmacher wrote:
> > > Hi Volker,
> > > hi Andrew,
> > 
> > > Maybe we can add some of this to lib/param/README?
> > > 
> > > I think the patches doesn't make the situation worse than it currently is,
> > 
> > Thanks,
> > 
> > Attached is a patch to add this documentation. 
> 
> Ok, good. See it as reviewed-by me.
>
> One thing sticks out
> immediately though is the requirement to use talloc_unlink.
> This needs to go ASAP. This is not acceptable. Sorry to be
> so strict, but talloc_reference/talloc_unlink is just a
> complete no-go in central code. Please focus on removing
> that very, very soon.

I absolutely agree generally, but I think talloc_unlink was
mentioned here just by habit instead of talloc_free:
Looking at the implementation of loadparm_init_s3():

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
struct loadparm_context *loadparm_init_s3(TALLOC_CTX *mem_ctx,
					  const struct loadparm_s3_helpers *s3_fns)
{
	struct loadparm_context *loadparm_context = talloc_zero(mem_ctx, struct loadparm_context);
	if (!loadparm_context) {
		return NULL;
	}
	loadparm_context->s3_fns = s3_fns;
	return loadparm_context;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

it seems that talloc_free() woule be safe on the return value, right?

Cheers - Michael



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 215 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131016/f1459522/attachment.pgp>


More information about the samba-technical mailing list