shell32: Fix a memory leak.

Signed-off-by: Haidong Yu <yuhaidong@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 479b659463)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Haidong Yu 2021-06-07 17:47:33 +08:00 committed by Michael Stefaniuc
parent 531247b84e
commit ef54f3c227
1 changed files with 4 additions and 1 deletions

View File

@ -2150,7 +2150,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;