msi/tests: Fix a few handle leaks.
This was pointed out by Christoph von Wittich.
This commit is contained in:
parent
51a04d5b65
commit
6d75522fb4
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue