diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-08-23 09:45:38 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:34:24 -0500 |
commit | 7b211a11c34d15aa51d40bab34080e31e48140d9 (patch) | |
tree | 2851fb4686ed1894da62362499edeaab2607bf5e /source4/libcli/security/security_token.c | |
parent | aaa0aff2d6cea65b07320790c16fff127c12a65b (diff) | |
download | samba-7b211a11c34d15aa51d40bab34080e31e48140d9.tar.gz samba-7b211a11c34d15aa51d40bab34080e31e48140d9.tar.bz2 samba-7b211a11c34d15aa51d40bab34080e31e48140d9.zip |
r9511: - fix the memory trees
- add a note about a possible talloc_free()
metze
(This used to be commit 550e3030f0e02720b527f3b4923457f05f484e6e)
Diffstat (limited to 'source4/libcli/security/security_token.c')
-rw-r--r-- | source4/libcli/security/security_token.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/libcli/security/security_token.c b/source4/libcli/security/security_token.c index ea1fae0c33..a23aa92bf3 100644 --- a/source4/libcli/security/security_token.c +++ b/source4/libcli/security/security_token.c @@ -78,14 +78,14 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx, * The only difference between guest and "anonymous" * is the addition of Authenticated_Users. */ - ptoken->sids[2] = dom_sid_parse_talloc(mem_ctx, SID_WORLD); + ptoken->sids[2] = dom_sid_parse_talloc(ptoken->sids, SID_WORLD); NT_STATUS_HAVE_NO_MEMORY(ptoken->sids[2]); - ptoken->sids[3] = dom_sid_parse_talloc(mem_ctx, SID_NT_NETWORK); + ptoken->sids[3] = dom_sid_parse_talloc(ptoken->sids, SID_NT_NETWORK); NT_STATUS_HAVE_NO_MEMORY(ptoken->sids[3]); ptoken->num_sids = 4; if (is_authenticated) { - ptoken->sids[4] = dom_sid_parse_talloc(mem_ctx, SID_NT_AUTHENTICATED_USERS); + ptoken->sids[4] = dom_sid_parse_talloc(ptoken->sids, SID_NT_AUTHENTICATED_USERS); NT_STATUS_HAVE_NO_MEMORY(ptoken->sids[4]); ptoken->num_sids++; } @@ -99,9 +99,9 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx, break; } } - + if (check_sid_idx == ptoken->num_sids) { - ptoken->sids[ptoken->num_sids++] = talloc_reference(ptoken, groupSIDs[i]); + ptoken->sids[ptoken->num_sids++] = talloc_reference(ptoken->sids, groupSIDs[i]); } } |