diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-11-29 03:19:28 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2004-11-29 03:19:28 +0000 |
commit | c1ec2f6d880b5c894e4a6e37d7f76235fcb2531b (patch) | |
tree | 8e1a2e5b627f02a4f7778f95e0627617f3d34b23 /source/libcli/security/dom_sid.c | |
parent | ff6177884720ef609ed1d0776b0f788da44beebb (diff) | |
download | samba-c1ec2f6d880b5c894e4a6e37d7f76235fcb2531b.tar.gz samba-c1ec2f6d880b5c894e4a6e37d7f76235fcb2531b.tar.xz samba-c1ec2f6d880b5c894e4a6e37d7f76235fcb2531b.zip |
r3988: made dom_sid_add_rid() allocate the new sid with proper parent/child talloc
relationship
Diffstat (limited to 'source/libcli/security/dom_sid.c')
-rw-r--r-- | source/libcli/security/dom_sid.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/libcli/security/dom_sid.c b/source/libcli/security/dom_sid.c index dbd03108e49..108e2f55007 100644 --- a/source/libcli/security/dom_sid.c +++ b/source/libcli/security/dom_sid.c @@ -217,7 +217,8 @@ struct dom_sid *dom_sid_dup(TALLOC_CTX *mem_ctx, const struct dom_sid *dom_sid) } /* - add a rid to a domain dom_sid to make a full dom_sid + add a rid to a domain dom_sid to make a full dom_sid. This function + returns a new sid in the suppplied memory context */ struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx, const struct dom_sid *domain_sid, @@ -229,14 +230,15 @@ struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx, if (!sid) return NULL; *sid = *domain_sid; - /*TODO: use realloc! */ - sid->sub_auths = talloc_array_p(mem_ctx, uint32_t, sid->num_auths+1); + + sid->sub_auths = talloc_array_p(sid, uint32_t, sid->num_auths+1); if (!sid->sub_auths) { return NULL; } memcpy(sid->sub_auths, domain_sid->sub_auths, sid->num_auths*sizeof(uint32_t)); sid->sub_auths[sid->num_auths] = rid; sid->num_auths++; + return sid; } |