diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-12-22 12:50:26 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-02-08 00:03:40 +0000 |
commit | 6f09f06adcae036a7197cb1bffaac86ab0c72945 (patch) | |
tree | 119f432f1167fc5a87a19bd0bc1822020d5e99ee /auth | |
parent | 77036bba013751021f7229f0d78011298b634501 (diff) | |
download | samba-6f09f06adcae036a7197cb1bffaac86ab0c72945.tar.gz |
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>
Diffstat (limited to 'auth')
-rw-r--r-- | auth/auth_sam_reply.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/auth/auth_sam_reply.c b/auth/auth_sam_reply.c index 23579eb4035..2a35723e355 100644 --- a/auth/auth_sam_reply.c +++ b/auth/auth_sam_reply.c @@ -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) { |