[PATCH] vfs_fruit: conversion of AppleDouble files with FinderInfo entry > 32 bytes

Jeremy Allison jra at samba.org
Wed Sep 3 04:01:31 MDT 2014


On Wed, Sep 03, 2014 at 11:57:00AM +0200, Ralph Böhme wrote:
> On Wed, Sep 03, 2014 at 02:24:48AM -0700, Jeremy Allison wrote:
> > On Wed, Sep 03, 2014 at 11:04:39AM +0200, Ralph Böhme wrote:
> > > Hi Jeremy,
> > > 
> > > On Wed, Sep 03, 2014 at 01:34:44AM -0700, Jeremy Allison wrote:
> > > > > +	path = talloc_asprintf(tctx, "%s/%s", spath, name);
> > > > 
> > > > I know this is only test code, but you still
> > > > must always check for allocataion fail after a
> > > > talloc_XXX(). So you need a :
> > > > 
> > > > 	if (path == NULL) {
> > > > 		TALLOC_FREE(space);
> > > > 		return false;
> > > > 	}
> > > > 
> > > > here.
> > > 
> > > thanks for spotting this. Updated patchset attached.
> > 
> > Sorry Ralph, that should have been:
> > 
> > >     if (path == NULL) {
> > >             TALLOC_FREE(spath);
> > >             return false;
> > >     }
> > 
> > i.e. spath, not space. My mistake.
> 
> my bad! I actually read and checked the symbol names, but misread
> space for spath. Guess need to find more coffee somewhere round
> here. ;)
> 
> But: are we actually supposed to free the static string returned by
> torture_setting_string() ? Afaict probably not, callchain:
> 
> torture_setting_string
> -> lpcfg_parm_string
>    -> lpcfg_get_parametric
>       -> get_parametric_helper
>    -> lpcfg_string
>       -> return pointer const string allocated in tp_talloc
>          context
> 
> Updated patched attached, this time withouth TALLOC_FREE() in case I'm
> right here. :)

OK, I'll take a look. I was assuming that
we needed to free anything we'd checked for
NULL return when passing in a talloc context,
but it's not completely neccessary anyway,
only checking for the NULL is needed :-).

Jeremy.


More information about the samba-technical mailing list