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

View File

@ -542,12 +542,17 @@ HRESULT WINAPI LoadRegTypeLib(
TLIBATTR *attr; TLIBATTR *attr;
res = ITypeLib_GetLibAttr(*ppTLib, &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_ReleaseTLibAttr(*ppTLib, attr);
ITypeLib_Release(*ppTLib);
*ppTLib = NULL; if (mismatch)
res = TYPE_E_LIBNOTREGISTERED; {
ITypeLib_Release(*ppTLib);
*ppTLib = NULL;
res = TYPE_E_LIBNOTREGISTERED;
}
} }
} }
} }