summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-03-10 21:13:56 +0100
committerJeremy Allison <jra@samba.org>2015-03-11 16:11:08 +0100
commitca598813808c7f06f248e78af302b966f5bbcd93 (patch)
treef08e5731e5a4ae5748f0816869d4d83924a746a0 /source3/auth
parent05cec933bdff4228291195d387c08bfcbf7a872a (diff)
downloadsamba-ca598813808c7f06f248e78af302b966f5bbcd93.tar.gz
smbd: Simplify create_token_from_sid()
This if-statement is unnecessary. First, talloc_array returns non-NULL even if asked for 0 elements. Second, a bit further down we do a SMB_ASSERT(num_group_sids > 0); Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/token_util.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index 6129cadb48c..1f95be60a54 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -793,15 +793,11 @@ static NTSTATUS create_token_from_sid(TALLOC_CTX *mem_ctx,
}
num_group_sids = getgroups_num_group_sids;
- if (num_group_sids) {
- group_sids = talloc_array(tmp_ctx, struct dom_sid, num_group_sids);
- if (group_sids == NULL) {
- DEBUG(1, ("talloc_array failed\n"));
- result = NT_STATUS_NO_MEMORY;
- goto done;
- }
- } else {
- group_sids = NULL;
+ group_sids = talloc_array(tmp_ctx, struct dom_sid, num_group_sids);
+ if (group_sids == NULL) {
+ DEBUG(1, ("talloc_array failed\n"));
+ result = NT_STATUS_NO_MEMORY;
+ goto done;
}
for (i=0; i<num_group_sids; i++) {