From 37d3edf9c901694b42a6badb368d71b1bb35c2fd Mon Sep 17 00:00:00 2001 From: Kevin Puetz Date: Mon, 27 Jan 2020 16:02:27 +0100 Subject: [PATCH] rpcrt4: Fix ITypeInfo leak in get_iface_info. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard (cherry picked from commit a09c08f17a1ace1205e4c579c4f08b548258d539) Signed-off-by: Michael Stefaniuc --- dlls/rpcrt4/ndr_typelib.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c index 7cb7da18adf..fb78c9b5abf 100644 --- a/dlls/rpcrt4/ndr_typelib.c +++ b/dlls/rpcrt4/ndr_typelib.c @@ -1265,14 +1265,16 @@ static HRESULT get_iface_info(ITypeInfo *typeinfo, WORD *funcs, WORD *parentfunc if (FAILED(hr)) goto err; hr = ITypeInfo_GetRefTypeInfo(*real_typeinfo, reftype, &parentinfo); + if (SUCCEEDED(hr)) + { + hr = ITypeInfo_GetTypeAttr(parentinfo, &typeattr); + ITypeInfo_Release(parentinfo); + } if (FAILED(hr)) goto err; - hr = ITypeInfo_GetTypeAttr(parentinfo, &typeattr); - if (FAILED(hr)) - goto err; + *parentiid = typeattr->guid; ITypeInfo_ReleaseTypeAttr(parentinfo, typeattr); - ITypeInfo_Release(parentinfo); return S_OK;