Correct a leaking hkey handle.

This commit is contained in:
Aric Stewart 2005-04-27 08:11:52 +00:00 committed by Alexandre Julliard
parent e197332fa7
commit afcaf83ed7
1 changed files with 7 additions and 0 deletions

View File

@ -505,15 +505,22 @@ UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute,
r = RegQueryValueExW(hkey, szPackageCode, NULL, NULL,
(LPBYTE)squished, &sz);
if (r != ERROR_SUCCESS)
{
RegCloseKey(hkey);
return ERROR_UNKNOWN_PRODUCT;
}
unsquash_guid(squished, package);
*pcchValueBuf = strlenW(package);
if (strlenW(package) > *pcchValueBuf)
{
RegCloseKey(hkey);
return ERROR_MORE_DATA;
}
else
strcpyW(szBuffer, package);
RegCloseKey(hkey);
r = ERROR_SUCCESS;
}
else if (strcmpW(szAttribute, szVersionString)==0)