Patch for memory leak in vfs_defaults.c

Jeremy Allison jra at
Fri Apr 6 21:02:12 UTC 2018

On Fri, Apr 06, 2018 at 01:55:38PM -0700, Jeremy Allison via samba-technical wrote:
> On Fri, Apr 06, 2018 at 04:40:44PM -0400, Andrew Walker via samba-technical wrote:
> > Hi all,
> > I encountered an issue where several FreeNAS users on samba 4.7 were
> > experiencing memory leak resulting in single smbd process consuming all
> > available RAM and swap space. Disabling the getwd cache significantly
> > increased rate of leak, and enabling widelinks / disabling unix extensions
> > made the leak apparently stop. Investigation indicated that the leak was in
> > vfswrap_getwd().
> > 
> > The attached patch resolved the issue.
> Oh god that's *embarassing*. Looks like my fault too, sorry.

Yes, it was my fault, sorry. I broke it in bd9285b19741128bae501b721d9e63dd9a9bd833
when I converted the VFS to return struct smb_filename pointers instead of raw
char * pointers.

More information about the samba-technical mailing list