From 14e63ff9129a8b56654c4eac6e46059176fd69d9 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 11 Mar 2019 13:28:05 +0300 Subject: [PATCH] mfplat: Free event value on release. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mfplat/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 6bec41884ef..7a8361f858f 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -2088,7 +2088,7 @@ HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver) return S_OK; } -typedef struct _mfmediaevent +typedef struct media_event { mfattributes attributes; IMFMediaEvent IMFMediaEvent_iface; @@ -2139,14 +2139,15 @@ static ULONG WINAPI mfmediaevent_AddRef(IMFMediaEvent *iface) static ULONG WINAPI mfmediaevent_Release(IMFMediaEvent *iface) { - mfmediaevent *This = impl_from_IMFMediaEvent(iface); - ULONG ref = InterlockedDecrement(&This->attributes.ref); + struct media_event *event = impl_from_IMFMediaEvent(iface); + ULONG ref = InterlockedDecrement(&event->attributes.ref); - TRACE("(%p) ref=%u\n", This, ref); + TRACE("(%p) ref=%u\n", iface, ref); if (!ref) { - HeapFree(GetProcessHeap(), 0, This); + PropVariantClear(&event->value); + heap_free(event); } return ref;