oleaut32: Always free TLIBATTR in LoadRegTypeLib() (Valgrind).

This commit is contained in:
Nikolay Sivov 2014-04-26 00:37:15 +04:00 committed by Alexandre Julliard
parent 3b16986a35
commit 0c0fe4efb4
1 changed files with 9 additions and 4 deletions

View File

@ -542,12 +542,17 @@ HRESULT WINAPI LoadRegTypeLib(
TLIBATTR *attr;
res = ITypeLib_GetLibAttr(*ppTLib, &attr);
if (res == S_OK && (attr->wMajorVerNum != wVerMajor || attr->wMinorVerNum < wVerMinor))
if (res == S_OK)
{
BOOL mismatch = attr->wMajorVerNum != wVerMajor || attr->wMinorVerNum < wVerMinor;
ITypeLib_ReleaseTLibAttr(*ppTLib, attr);
ITypeLib_Release(*ppTLib);
*ppTLib = NULL;
res = TYPE_E_LIBNOTREGISTERED;
if (mismatch)
{
ITypeLib_Release(*ppTLib);
*ppTLib = NULL;
res = TYPE_E_LIBNOTREGISTERED;
}
}
}
}