windowscodecs: Do not leak profile on errors (Coverity).
This commit is contained in:
parent
339ec9c4ed
commit
4641ed5c95
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue