From 6d75522fb4d8379ba8de2be3a9c0cf1c70e1fff3 Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Sun, 18 Jan 2009 04:48:05 -0600 Subject: [PATCH] msi/tests: Fix a few handle leaks. This was pointed out by Christoph von Wittich. --- dlls/msi/tests/install.c | 1 + dlls/msi/tests/msi.c | 1 + dlls/msi/tests/package.c | 1 + dlls/msi/tests/source.c | 1 + 4 files changed, 4 insertions(+) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 53602845e05..96b85b99f9f 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -1365,6 +1365,7 @@ static void get_user_sid(LPSTR *usersid) GetTokenInformation(token, TokenUser, buf, size, &size); user = (PTOKEN_USER)buf; pConvertSidToStringSidA(user->User.Sid, usersid); + CloseHandle(token); } static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val) diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index fba584dca89..da89faabf40 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -525,6 +525,7 @@ static void get_user_sid(LPSTR *usersid) GetTokenInformation(token, TokenUser, buf, size, &size); user = (PTOKEN_USER)buf; pConvertSidToStringSidA(user->User.Sid, usersid); + CloseHandle(token); } static void test_MsiQueryProductState(void) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 66ff3f0ebca..04ad64c83e3 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -51,6 +51,7 @@ static void get_user_sid(LPSTR *usersid) GetTokenInformation(token, TokenUser, buf, size, &size); user = (PTOKEN_USER)buf; pConvertSidToStringSidA(user->User.Sid, usersid); + CloseHandle(token); } /* RegDeleteTreeW from dlls/advapi32/registry.c */ diff --git a/dlls/msi/tests/source.c b/dlls/msi/tests/source.c index 2eb5f1815ec..5e21d67cad8 100644 --- a/dlls/msi/tests/source.c +++ b/dlls/msi/tests/source.c @@ -139,6 +139,7 @@ static int get_user_sid(LPSTR *usersid) GetTokenInformation(token, TokenUser, buf, size, &size); user = (PTOKEN_USER)buf; pConvertSidToStringSidA(user->User.Sid, usersid); + CloseHandle(token); return 1; }