shell32: Fix a memory leak.

Signed-off-by: Haidong Yu <yuhaidong@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Haidong Yu 2021-06-07 17:47:33 +08:00 committed by Alexandre Julliard
parent f43c01fa82
commit 479b659463
1 changed files with 4 additions and 1 deletions

View File

@ -2158,7 +2158,10 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
if (*pszFile == '\0')
*buffer = '\0';
else if (!GetFullPathNameW(pszFile, MAX_PATH, buffer, &fname))
return E_FAIL;
{
heap_free(unquoted);
return E_FAIL;
}
else if(!PathFileExistsW(buffer) &&
!SearchPathW(NULL, pszFile, NULL, MAX_PATH, buffer, NULL))
hr = S_FALSE;