Re: msi: Fix some leaks (coverity)
Frédéric Delanoy <frederic.delanoy(a)gmail.com> writes:
@@ -151,15 +151,23 @@ static UINT propvar_changetype(PROPVARIANT *changed, PROPVARIANT *property, VART { HRESULT hr; HMODULE propsys = LoadLibraryA("propsys.dll"); + + if (!propsys) + { + ERR("Failed to load propsys.dll: %u\n", GetLastError()); + return ERROR_DLL_NOT_FOUND; + } pPropVariantChangeType = (void *)GetProcAddress(propsys, "PropVariantChangeType");
if (!pPropVariantChangeType) { ERR("PropVariantChangeType function missing!\n"); + FreeLibrary(propsys); return ERROR_FUNCTION_FAILED; }
hr = pPropVariantChangeType(changed, property, 0, vt); + FreeLibrary(propsys);
You don't want to load/unload the library on every call. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard