[PATCH 2/6] Fix default parameter variant leak
Nikolay Sivov
nsivov at codeweavers.com
Fri Jan 28 17:12:56 CST 2011
---
dlls/oleaut32/typelib2.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index 8260ef2..f87ed9f 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -3313,6 +3313,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncDesc(
}
(*ppFuncDesc)->lprgelemdescParam[i].u.paramdesc.pparamdescex->cBytes = sizeof(PARAMDESCEX);
+ VariantInit(&(*ppFuncDesc)->lprgelemdescParam[i].u.paramdesc.pparamdescex->varDefaultValue);
hres = ctl2_decode_variant(This->typelib, typedata[hdr_len + i],
&(*ppFuncDesc)->lprgelemdescParam[i].u.paramdesc.pparamdescex->varDefaultValue);
if (FAILED(hres)) {
@@ -3749,7 +3750,11 @@ static void WINAPI ITypeInfo2_fnReleaseFuncDesc(
if (pFuncDesc->lprgelemdescParam[i].tdesc.vt != VT_USERDEFINED)
release_typedesc(pFuncDesc->lprgelemdescParam[i].tdesc.u.lptdesc);
- heap_free(pFuncDesc->lprgelemdescParam[i].u.paramdesc.pparamdescex);
+ if (pFuncDesc->lprgelemdescParam[i].u.paramdesc.pparamdescex)
+ {
+ VariantClear(&pFuncDesc->lprgelemdescParam[i].u.paramdesc.pparamdescex->varDefaultValue);
+ heap_free(pFuncDesc->lprgelemdescParam[i].u.paramdesc.pparamdescex);
+ }
}
heap_free(pFuncDesc->lprgelemdescParam);
}
--
1.5.6.5
--------------060500070703080101040802--
More information about the wine-patches
mailing list