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

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-03-12 12:16:54 +03:00 committed by Alexandre Julliard
parent 59103375b9
commit 8b67cfb8e4

View File

@ -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)