From 33a193439d03a06555e8517d371e27b12e64c00d Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 15 Dec 2009 15:20:29 +0000 Subject: [PATCH] qedit: Fix a memory leak. Found by Valgrind. --- dlls/qedit/mediadet.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/qedit/mediadet.c b/dlls/qedit/mediadet.c index d27a638f361..3a13f717bf6 100644 --- a/dlls/qedit/mediadet.c +++ b/dlls/qedit/mediadet.c @@ -310,7 +310,11 @@ static HRESULT GetFilterInfo(IMoniker *pMoniker, GUID *pclsid, VARIANT *pvar) hr = IPropertyBag_Read(pPropBagCat, wszClsidName, pvar, NULL); if (SUCCEEDED(hr)) + { hr = CLSIDFromString(V_UNION(pvar, bstrVal), pclsid); + VariantClear(pvar); + V_VT(pvar) = VT_BSTR; + } if (SUCCEEDED(hr)) hr = IPropertyBag_Read(pPropBagCat, wszFriendlyName, pvar, NULL); @@ -387,10 +391,14 @@ static HRESULT GetSplitter(MediaDetImpl *This) hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (void **) &splitter); if (FAILED(hr)) + { + VariantClear(&var); return hr; + } hr = IGraphBuilder_AddFilter(This->graph, splitter, V_UNION(&var, bstrVal)); + VariantClear(&var); if (FAILED(hr)) { IBaseFilter_Release(splitter);