[PATCH 00/27] fix talloc stackframe leaks in remaining xx_path callers

Andrew Bartlett abartlet at samba.org
Sun Nov 2 14:28:45 MST 2014


On Sun, 2014-11-02 at 20:21 +0100, David Disseldorp wrote:
> cache_path(), lock_path() and state_path() all call xx_path() to return
> a string allocated on the talloc_tos() context. The majority of the
> callers do not free the returned string, nor do they check for
> allocation failures.
> 
> The cache_path() callers were fixed with
> https://lists.samba.org/archive/samba-technical/2014-October/102836.html
> This patch-set addresses the remaining lock_path() and state_path()
> callers.
> 
> Feedback appreciated.

My preference is that functions never return memory on talloc_tos(), and
that it (or better, a talloc_stackframe context) be passed in as the
memory context.  That makes it clear what the allocation behaviour is.

Rusty did this for all the lp_ functions a while back, for example.

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba






More information about the samba-technical mailing list