Commit 0c0fe4ef authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent 3b16986a
......@@ -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;
}
}
}
}
......
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