[INETCOMM_WINETEST] Sync with Wine Staging 2.9. CORE-13362
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 3 Jun 2017 22:27:55 +0000 (22:27 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 3 Jun 2017 22:27:55 +0000 (22:27 +0000)
svn path=/trunk/; revision=74809

rostests/winetests/inetcomm/mimeole.c

index b11e488..0d3f4bd 100644 (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)