urlmon: Avoid memory leaks (coverity).

This commit is contained in:
André Hentschel 2012-10-28 16:17:03 +01:00 committed by Alexandre Julliard
parent b4b396a957
commit 99a0c55a8f
2 changed files with 9 additions and 2 deletions

View File

@ -1149,7 +1149,10 @@ static HRESULT WINAPI BPInternetProtocolSink_Switch(IInternetProtocolSink *iface
task = heap_alloc(sizeof(switch_task_t));
if(!task)
{
heap_free(data);
return E_OUTOFMEMORY;
}
task->data = data;

View File

@ -5185,8 +5185,10 @@ static HRESULT WINAPI PersistStream_Load(IPersistStream *iface, IStream *pStm)
if(!data)
return E_OUTOFMEMORY;
hr = IStream_Read(pStm, &data->unk1, size-sizeof(DWORD)-2, NULL);
if(FAILED(hr))
if(FAILED(hr)) {
heap_free(data);
return hr;
}
if(size < sizeof(struct persist_uri)) {
heap_free(data);
@ -6356,8 +6358,10 @@ HRESULT WINAPI CreateIUriBuilder(IUri *pIUri, DWORD dwFlags, DWORD_PTR dwReserve
Uri *uri;
if((uri = get_uri_obj(pIUri))) {
if(!uri->create_flags)
if(!uri->create_flags) {
heap_free(ret);
return E_UNEXPECTED;
}
IUri_AddRef(pIUri);
ret->uri = uri;