Commit 4641ed5c authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

windowscodecs: Do not leak profile on errors (Coverity).

parent 339ec9c4
......@@ -126,8 +126,16 @@ static HRESULT load_profile(const WCHAR *filename, BYTE **profile, UINT *len)
}
ret = ReadFile(handle, *profile, size.u.LowPart, &count, NULL);
CloseHandle(handle);
if (!ret) return HRESULT_FROM_WIN32(GetLastError());
if (count != size.u.LowPart) return E_FAIL;
if (!ret) {
HeapFree (GetProcessHeap(),0,*profile);
*profile = NULL;
return HRESULT_FROM_WIN32(GetLastError());
}
if (count != size.u.LowPart) {
HeapFree (GetProcessHeap(),0,*profile);
*profile = NULL;
return E_FAIL;
}
*len = count;
return S_OK;
}
......
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