[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: shell32: implement SHGetFolderPathAndSubDirA/W [2nd resend]
From:       Alexandre Julliard <julliard () winehq ! org>
Date:       2008-03-31 14:01:21
Message-ID: 87wsnj6lhq.fsf () wine ! dyndns ! org
[Download RAW message or body]

Stefan Leichter <Stefan.Leichter@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).

-- 
Alexandre Julliard
julliard@winehq.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic