Commit d902249e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Fix default parameter variant leak (Valgrind).

parent 96d225d4
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment