Commit 4f2db2ae authored by Alexandre Julliard's avatar Alexandre Julliard

ole32: Fix a couple of reference leaks.

parent b045d726
...@@ -2063,12 +2063,12 @@ static HRESULT PropertyStorage_BaseConstruct(IStream *stm, ...@@ -2063,12 +2063,12 @@ static HRESULT PropertyStorage_BaseConstruct(IStream *stm,
hr = PropertyStorage_CreateDictionaries(*pps); hr = PropertyStorage_CreateDictionaries(*pps);
if (FAILED(hr)) if (FAILED(hr))
{ {
IStream_Release(stm);
(*pps)->cs.DebugInfo->Spare[0] = 0; (*pps)->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&(*pps)->cs); DeleteCriticalSection(&(*pps)->cs);
HeapFree(GetProcessHeap(), 0, *pps); HeapFree(GetProcessHeap(), 0, *pps);
*pps = NULL; *pps = NULL;
} }
else IStream_AddRef( stm );
return hr; return hr;
} }
...@@ -2090,11 +2090,7 @@ static HRESULT PropertyStorage_ConstructFromStream(IStream *stm, ...@@ -2090,11 +2090,7 @@ static HRESULT PropertyStorage_ConstructFromStream(IStream *stm,
TRACE("PropertyStorage %p constructed\n", ps); TRACE("PropertyStorage %p constructed\n", ps);
hr = S_OK; hr = S_OK;
} }
else else IPropertyStorage_Release( &ps->IPropertyStorage_iface );
{
PropertyStorage_DestroyDictionaries(ps);
HeapFree(GetProcessHeap(), 0, ps);
}
} }
return hr; return hr;
} }
...@@ -2222,6 +2218,8 @@ static HRESULT WINAPI IPropertySetStorage_fnCreate( ...@@ -2222,6 +2218,8 @@ static HRESULT WINAPI IPropertySetStorage_fnCreate(
r = PropertyStorage_ConstructEmpty(stm, rfmtid, grfFlags, grfMode, ppprstg); r = PropertyStorage_ConstructEmpty(stm, rfmtid, grfFlags, grfMode, ppprstg);
IStream_Release( stm );
end: end:
TRACE("returning 0x%08x\n", r); TRACE("returning 0x%08x\n", r);
return r; return r;
...@@ -2267,6 +2265,8 @@ static HRESULT WINAPI IPropertySetStorage_fnOpen( ...@@ -2267,6 +2265,8 @@ static HRESULT WINAPI IPropertySetStorage_fnOpen(
r = PropertyStorage_ConstructFromStream(stm, rfmtid, grfMode, ppprstg); r = PropertyStorage_ConstructFromStream(stm, rfmtid, grfMode, ppprstg);
IStream_Release( stm );
end: end:
TRACE("returning 0x%08x\n", r); TRACE("returning 0x%08x\n", r);
return r; return r;
...@@ -2804,6 +2804,8 @@ HRESULT WINAPI StgCreatePropStg(IUnknown *unk, REFFMTID fmt, const CLSID *clsid, ...@@ -2804,6 +2804,8 @@ HRESULT WINAPI StgCreatePropStg(IUnknown *unk, REFFMTID fmt, const CLSID *clsid,
r = PropertyStorage_ConstructEmpty(stm, fmt, flags, r = PropertyStorage_ConstructEmpty(stm, fmt, flags,
STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, prop_stg); STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, prop_stg);
IStream_Release( stm );
} }
end: end:
...@@ -2847,6 +2849,8 @@ HRESULT WINAPI StgOpenPropStg(IUnknown *unk, REFFMTID fmt, DWORD flags, ...@@ -2847,6 +2849,8 @@ HRESULT WINAPI StgOpenPropStg(IUnknown *unk, REFFMTID fmt, DWORD flags,
r = PropertyStorage_ConstructFromStream(stm, fmt, r = PropertyStorage_ConstructFromStream(stm, fmt,
STGM_READWRITE|STGM_SHARE_EXCLUSIVE, prop_stg); STGM_READWRITE|STGM_SHARE_EXCLUSIVE, prop_stg);
IStream_Release( stm );
} }
end: end:
......
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