modules/vfs_default.c:vfswrap_is_offline uses talloc_tos ...

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Sep 26 00:44:06 MDT 2011


On Sun, Sep 25, 2011 at 03:39:18PM -0700, Richard Sharpe wrote:
> In the function source3/modules/vfs_default.c:vfswrap_is_offline we
> see the following:
> 
>         status = get_full_smb_filename(talloc_tos(), fname, &path);
>         if (!NT_STATUS_IS_OK(status)) {
>                 errno = map_errno_from_nt_status(status);
>                 return false;
>         }
> 
>         return (dmapi_file_flags(path) & FILE_ATTRIBUTE_OFFLINE) != 0;
> 
> Should the path that was allocated above be freed? Sure, it will get
> cleaned up, but perhaps it should be explicitly freed.

You're fully right. This is sloppy programming. That routine
should free its allocations explicitly.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen


More information about the samba-technical mailing list