diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c index 69d610f2503..2353ac3e56e 100644 --- a/dlls/shell32/shelllink.c +++ b/dlls/shell32/shelllink.c @@ -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;