msi: fix for leaking handle in my last patch

Aric Stewart aric at codeweavers.com
Tue Apr 26 13:13:39 CDT 2005


Corrects a leaking hkey handle.
-------------- next part --------------
Index: dlls/msi/msi.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/msi.c,v
retrieving revision 1.76
diff -u -r1.76 msi.c
--- dlls/msi/msi.c	26 Apr 2005 14:30:31 -0000	1.76
+++ dlls/msi/msi.c	26 Apr 2005 18:12:03 -0000
@@ -505,15 +505,22 @@
         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)


More information about the wine-patches mailing list