Commit 2dac8052 authored by Sven Baars's avatar Sven Baars Committed by Alexandre Julliard

shell32: Fix a leak on error path (Coverity).

parent 94b2db85
......@@ -1251,7 +1251,10 @@ static HRESULT WINAPI ShellFolder2_GetDisplayNameOf(IShellFolder2* iface,
LPWSTR pwszDosFileName = wine_get_dos_file_name(This->m_pszPath);
if (!pwszDosFileName) return HRESULT_FROM_WIN32(GetLastError());
lpName->u.pOleStr = SHAlloc((lstrlenW(pwszDosFileName) + 1) * sizeof(WCHAR));
if (!lpName->u.pOleStr) return HRESULT_FROM_WIN32(GetLastError());
if (!lpName->u.pOleStr) {
heap_free(pwszDosFileName);
return HRESULT_FROM_WIN32(GetLastError());
}
lstrcpyW(lpName->u.pOleStr, pwszDosFileName);
PathRemoveBackslashW(lpName->u.pOleStr);
heap_free(pwszDosFileName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment