shell32: implement SHGetFolderPathAndSubDirA/W [try2]

Stefan Leichter Stefan.Leichter at camline.com
Sat Apr 12 15:12:41 CDT 2008


Am Monday 31 March 2008 16:01 schrieb Alexandre Julliard:
> Stefan Leichter <Stefan.Leichter at camline.com> writes:
> > +    if (pszSubPath && (length = MultiByteToWideChar(CP_ACP, 0,
> > pszSubPath, -1, NULL, 0))) { +        pszSubPathW =
> > HeapAlloc(GetProcessHeap(), 0, length * sizeof(WCHAR)); +       
> > if(!pszSubPathW)
> > +            return HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
>
> You are leaking memory on error. Also I don't think it makes sense to
> test the return value of MultiByteToWideChar, it shouldn't fail in this
> case (or if you test it, then you need to handle the error properly, not
> use an empty path instead).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SHGetFolderPathAndSubDir.diff
Type: text/x-diff
Size: 6099 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080412/eb4cf6a7/attachment.diff 


More information about the wine-patches mailing list