Some memory leaks in the master smbd ...

Jeremy Allison jra at samba.org
Thu May 31 13:20:27 MDT 2012


On Thu, May 31, 2012 at 12:11:04PM -0700, Richard Sharpe wrote:
> Hi folks,
> 
> It seems that there are some memory leaks in the master smbd because
> of things like lp_logfile in the following fragment from
> lib/debug.c:reopen_logs:
> 
>                 logfname = lp_logfile();
>                 if (*logfname) {
>                         SAFE_FREE(fname);
>                         fname = SMB_STRDUP(logfname);
>                         if (!fname) {
>                                 return false;
>                         }
>                 }
> 
> The space for lp_logfile is allocated using talloc using talloc_tos as
> a context, however, in the master smbd it seems that that stackframe
> is never cleaned up.
> 
> These were found with long-running tests of Samba 3.5.14 or so.
> 
> I have a set of about six patches to clean things like this up.
> 
> Do they look like issues?

Yes, any leaks in the master are issues - please push and open
a bug so we'll get them into 3.5.x and 3.6.x.

Cheers !

Jeremy.


More information about the samba-technical mailing list