From 60751dbf95b9780d741c3d2c219fdc087f8f8ab6 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 3 Jun 2017 22:27:55 +0000 Subject: [PATCH] [INETCOMM_WINETEST] Sync with Wine Staging 2.9. CORE-13362 svn path=/trunk/; revision=74809 --- rostests/winetests/inetcomm/mimeole.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rostests/winetests/inetcomm/mimeole.c b/rostests/winetests/inetcomm/mimeole.c index b11e4883114..0d3f4bdcc7f 100644 --- a/rostests/winetests/inetcomm/mimeole.c +++ b/rostests/winetests/inetcomm/mimeole.c @@ -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)