msi/tests: Fix a couple of memory leaks (valgrind).
This commit is contained in:
parent
582c5fde99
commit
4c8edb1b4c
|
@ -2255,20 +2255,22 @@ static void init_functionpointers(void)
|
|||
static BOOL is_process_limited(void)
|
||||
{
|
||||
SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
|
||||
PSID Group;
|
||||
PSID Group = NULL;
|
||||
BOOL IsInGroup;
|
||||
HANDLE token;
|
||||
|
||||
if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
|
||||
|
||||
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
|
||||
DOMAIN_ALIAS_RID_ADMINS,
|
||||
0, 0, 0, 0, 0, 0, &Group) ||
|
||||
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
|
||||
!pCheckTokenMembership(NULL, Group, &IsInGroup))
|
||||
{
|
||||
trace("Could not check if the current user is an administrator\n");
|
||||
FreeSid(Group);
|
||||
return FALSE;
|
||||
}
|
||||
FreeSid(Group);
|
||||
|
||||
if (!IsInGroup)
|
||||
{
|
||||
/* Only administrators have enough privileges for these tests */
|
||||
|
|
|
@ -230,20 +230,22 @@ static void init_functionpointers(void)
|
|||
static BOOL is_process_limited(void)
|
||||
{
|
||||
SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
|
||||
PSID Group;
|
||||
PSID Group = NULL;
|
||||
BOOL IsInGroup;
|
||||
HANDLE token;
|
||||
|
||||
if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
|
||||
|
||||
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
|
||||
DOMAIN_ALIAS_RID_ADMINS,
|
||||
0, 0, 0, 0, 0, 0, &Group) ||
|
||||
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
|
||||
!pCheckTokenMembership(NULL, Group, &IsInGroup))
|
||||
{
|
||||
trace("Could not check if the current user is an administrator\n");
|
||||
FreeSid(Group);
|
||||
return FALSE;
|
||||
}
|
||||
FreeSid(Group);
|
||||
|
||||
if (!IsInGroup)
|
||||
{
|
||||
/* Only administrators have enough privileges for these tests */
|
||||
|
|
|
@ -2043,20 +2043,22 @@ static void init_functionpointers(void)
|
|||
static BOOL is_process_limited(void)
|
||||
{
|
||||
SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
|
||||
PSID Group;
|
||||
PSID Group = NULL;
|
||||
BOOL IsInGroup;
|
||||
HANDLE token;
|
||||
|
||||
if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
|
||||
|
||||
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
|
||||
DOMAIN_ALIAS_RID_ADMINS,
|
||||
0, 0, 0, 0, 0, 0, &Group) ||
|
||||
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
|
||||
!pCheckTokenMembership(NULL, Group, &IsInGroup))
|
||||
{
|
||||
trace("Could not check if the current user is an administrator\n");
|
||||
FreeSid(Group);
|
||||
return FALSE;
|
||||
}
|
||||
FreeSid(Group);
|
||||
|
||||
if (!IsInGroup)
|
||||
{
|
||||
/* Only administrators have enough privileges for these tests */
|
||||
|
|
|
@ -175,20 +175,22 @@ static BOOL delete_pf(const char *rel_path, BOOL is_file)
|
|||
static BOOL is_process_limited(void)
|
||||
{
|
||||
SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
|
||||
PSID Group;
|
||||
PSID Group = NULL;
|
||||
BOOL IsInGroup;
|
||||
HANDLE token;
|
||||
|
||||
if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
|
||||
|
||||
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
|
||||
DOMAIN_ALIAS_RID_ADMINS,
|
||||
0, 0, 0, 0, 0, 0, &Group) ||
|
||||
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
|
||||
!pCheckTokenMembership(NULL, Group, &IsInGroup))
|
||||
{
|
||||
trace("Could not check if the current user is an administrator\n");
|
||||
FreeSid(Group);
|
||||
return FALSE;
|
||||
}
|
||||
FreeSid(Group);
|
||||
|
||||
if (!IsInGroup)
|
||||
{
|
||||
/* Only administrators have enough privileges for these tests */
|
||||
|
|
|
@ -88,20 +88,22 @@ static void init_functionpointers(void)
|
|||
static BOOL is_process_limited(void)
|
||||
{
|
||||
SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
|
||||
PSID Group;
|
||||
PSID Group = NULL;
|
||||
BOOL IsInGroup;
|
||||
HANDLE token;
|
||||
|
||||
if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
|
||||
|
||||
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
|
||||
DOMAIN_ALIAS_RID_ADMINS,
|
||||
0, 0, 0, 0, 0, 0, &Group) ||
|
||||
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
|
||||
!pCheckTokenMembership(NULL, Group, &IsInGroup))
|
||||
{
|
||||
trace("Could not check if the current user is an administrator\n");
|
||||
FreeSid(Group);
|
||||
return FALSE;
|
||||
}
|
||||
FreeSid(Group);
|
||||
|
||||
if (!IsInGroup)
|
||||
{
|
||||
if (!AllocateAndInitializeSid(&NtAuthority, 2,
|
||||
|
|
Loading…
Reference in New Issue