shell32: implement SHGetFolderPathAndSubDirA/W [2nd resend]

Alexandre Julliard julliard at
Mon Mar 31 09:01:21 CDT 2008

Stefan Leichter <Stefan.Leichter at> writes:

> +    if (pszSubPath && (length = MultiByteToWideChar(CP_ACP, 0, pszSubPath, -1, NULL, 0))) {
> +        pszSubPathW = HeapAlloc(GetProcessHeap(), 0, length * sizeof(WCHAR));
> +        if(!pszSubPathW)

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).

Alexandre Julliard
julliard at

More information about the wine-devel mailing list