From afcaf83ed7fda840e0c5f39f80f8ea3742efed78 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Wed, 27 Apr 2005 08:11:52 +0000 Subject: [PATCH] Correct a leaking hkey handle. --- dlls/msi/msi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index a89f91981c5..e39459ee9e3 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -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)