msi/tests: Fix a few handle leaks.

This was pointed out by Christoph von Wittich.
This commit is contained in:
Andrew Nguyen 2009-01-18 04:48:05 -06:00 committed by Alexandre Julliard
parent 51a04d5b65
commit 6d75522fb4
4 changed files with 4 additions and 0 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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 */

View File

@ -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;
}