[3/4] msi/tests: Fix some leaks.

Hans Leidekker hans at codeweavers.com
Fri Apr 20 03:56:27 CDT 2012


---
 dlls/msi/tests/msi.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index 67b7e52..c0ca658 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -11819,7 +11819,7 @@ static void test_MsiEnumProductsEx(void)
     char product0[39], product1[39], product2[39], product3[39], guid[39], sid[128];
     char product_squashed1[33], product_squashed2[33], product_squashed3[33];
     char keypath1[MAX_PATH], keypath2[MAX_PATH], keypath3[MAX_PATH];
-    HKEY key1, key2, key3;
+    HKEY key1 = NULL, key2 = NULL, key3 = NULL;
     REGSAM access = KEY_ALL_ACCESS;
     char *usersid = get_user_sid();
 
@@ -11837,8 +11837,7 @@ static void test_MsiEnumProductsEx(void)
     if (r == ERROR_ACCESS_DENIED)
     {
         skip( "insufficient rights\n" );
-        LocalFree( usersid );
-        return;
+        goto done;
     }
     ok( r == ERROR_SUCCESS, "got %u\n", r );
 
@@ -11919,8 +11918,7 @@ static void test_MsiEnumProductsEx(void)
     if (r == ERROR_ACCESS_DENIED)
     {
         skip( "insufficient rights\n" );
-        LocalFree( usersid );
-        return;
+        goto done;
     }
     ok( r == ERROR_SUCCESS, "got %u\n", r );
     ok( guid[0], "empty guid\n" );
@@ -11960,6 +11958,7 @@ static void test_MsiEnumProductsEx(void)
         len = sizeof(sid);
     }
 
+done:
     delete_key( key1, "", access );
     delete_key( key2, "", access );
     delete_key( key3, "", access );
-- 
1.7.5.4







More information about the wine-patches mailing list