mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
auth: Free empty SID arrays
In the unlikely event that these arrays are empty, they can be freed early. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
77036bba01
commit
6f09f06adc
@ -270,6 +270,10 @@ static NTSTATUS auth_convert_user_info_dc_sambaseinfo(TALLOC_CTX *mem_ctx,
|
||||
sam->groups.rids[sam->groups.count].attributes = group_sid->attrs;
|
||||
sam->groups.count += 1;
|
||||
}
|
||||
|
||||
if (sam->groups.count == 0) {
|
||||
TALLOC_FREE(sam->groups.rids);
|
||||
}
|
||||
}
|
||||
|
||||
sam->user_flags = info->user_flags; /* w2k3 uses NETLOGON_EXTRA_SIDS | NETLOGON_NTLMV2_ENABLED */
|
||||
@ -395,7 +399,7 @@ NTSTATUS auth_convert_user_info_dc_saminfo6(TALLOC_CTX *mem_ctx,
|
||||
if (sam6->sidcount) {
|
||||
sam6->base.user_flags |= NETLOGON_EXTRA_SIDS;
|
||||
} else {
|
||||
sam6->sids = NULL;
|
||||
TALLOC_FREE(sam6->sids);
|
||||
}
|
||||
|
||||
if (user_info_dc->info->dns_domain_name != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user