Commit 8b67cfb8 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

inetcomm/tests: Fix test stream leak (Valgrind).

parent 59103375
......@@ -323,7 +323,12 @@ static ULONG WINAPI Stream_AddRef(IStream *iface)
static ULONG WINAPI Stream_Release(IStream *iface)
{
TestStream *This = impl_from_IStream(iface);
return InterlockedDecrement(&This->ref);
ULONG ref = InterlockedDecrement(&This->ref);
if (!ref)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static HRESULT WINAPI Stream_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
......
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