diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-07 11:58:39 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-09 12:40:08 +0200 |
commit | 5e26e94092b56ee47e7ec7837f7cd0feb3fb0119 (patch) | |
tree | c63b385bc035e4e13d3cfb0e7063d8e8573cfdd0 /source3/winbindd | |
parent | ad0a07c531fadd1639c5298951cfaf5cfe0cb10e (diff) | |
download | samba-5e26e94092b56ee47e7ec7837f7cd0feb3fb0119.tar.gz samba-5e26e94092b56ee47e7ec7837f7cd0feb3fb0119.tar.bz2 samba-5e26e94092b56ee47e7ec7837f7cd0feb3fb0119.zip |
s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/idmap_hash/idmap_hash.c | 2 | ||||
-rw-r--r-- | source3/winbindd/winbindd_ads.c | 14 | ||||
-rw-r--r-- | source3/winbindd/winbindd_cache.c | 2 | ||||
-rw-r--r-- | source3/winbindd/winbindd_msrpc.c | 6 | ||||
-rw-r--r-- | source3/winbindd/winbindd_rpc.c | 8 | ||||
-rw-r--r-- | source3/winbindd/winbindd_sids_to_xids.c | 2 |
6 files changed, 17 insertions, 17 deletions
diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c index 474387918e..a6e883c474 100644 --- a/source3/winbindd/idmap_hash/idmap_hash.c +++ b/source3/winbindd/idmap_hash/idmap_hash.c @@ -127,7 +127,7 @@ static NTSTATUS be_init(struct idmap_domain *dom) /* Create the hash table of domain SIDs */ - hashed_domains = TALLOC_ZERO_ARRAY(dom, struct sid_hash_table, 4096); + hashed_domains = talloc_zero_array(dom, struct sid_hash_table, 4096); BAIL_ON_PTR_NT_ERROR(hashed_domains, nt_status); /* create the hash table of domain SIDs */ diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index 770ed43aa0..610db7a62b 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -199,7 +199,7 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, goto done; } - (*pinfo) = TALLOC_ZERO_ARRAY(mem_ctx, struct wbint_userinfo, count); + (*pinfo) = talloc_zero_array(mem_ctx, struct wbint_userinfo, count); if (!*pinfo) { status = NT_STATUS_NO_MEMORY; goto done; @@ -351,7 +351,7 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain, goto done; } - (*info) = TALLOC_ZERO_ARRAY(mem_ctx, struct wb_acct_info, count); + (*info) = talloc_zero_array(mem_ctx, struct wb_acct_info, count); if (!*info) { status = NT_STATUS_NO_MEMORY; goto done; @@ -769,7 +769,7 @@ static NTSTATUS lookup_usergroups_memberof(struct winbindd_domain *domain, goto done; } - group_sids = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_strings + 1); + group_sids = talloc_zero_array(mem_ctx, struct dom_sid, num_strings + 1); if (!group_sids) { status = NT_STATUS_NO_MEMORY; goto done; @@ -1085,10 +1085,10 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, * cache. Only the rest is passed to the lsa_lookup_sids call. */ if (num_members) { - (*sid_mem) = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_members); - (*names) = TALLOC_ZERO_ARRAY(mem_ctx, char *, num_members); - (*name_types) = TALLOC_ZERO_ARRAY(mem_ctx, uint32, num_members); - (sid_mem_nocache) = TALLOC_ZERO_ARRAY(tmp_ctx, struct dom_sid, num_members); + (*sid_mem) = talloc_zero_array(mem_ctx, struct dom_sid, num_members); + (*names) = talloc_zero_array(mem_ctx, char *, num_members); + (*name_types) = talloc_zero_array(mem_ctx, uint32, num_members); + (sid_mem_nocache) = talloc_zero_array(tmp_ctx, struct dom_sid, num_members); if ((members == NULL) || (*sid_mem == NULL) || (*names == NULL) || (*name_types == NULL) || diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index 05261b70b0..1c4f5bd701 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -2774,7 +2774,7 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain, } do_fetch_cache: - trusts->array = TALLOC_ZERO_ARRAY(mem_ctx, struct netr_DomainTrust, num_domains); + trusts->array = talloc_zero_array(mem_ctx, struct netr_DomainTrust, num_domains); if (!trusts->array) { TALLOC_FREE(dom_list); return NT_STATUS_NO_MEMORY; diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c index 699320206a..9ef0d87f5a 100644 --- a/source3/winbindd/winbindd_msrpc.c +++ b/source3/winbindd/winbindd_msrpc.c @@ -701,9 +701,9 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain, #define MAX_LOOKUP_RIDS 900 - *names = TALLOC_ZERO_ARRAY(mem_ctx, char *, *num_names); - *name_types = TALLOC_ZERO_ARRAY(mem_ctx, uint32, *num_names); - *sid_mem = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, *num_names); + *names = talloc_zero_array(mem_ctx, char *, *num_names); + *name_types = talloc_zero_array(mem_ctx, uint32, *num_names); + *sid_mem = talloc_zero_array(mem_ctx, struct dom_sid, *num_names); for (j=0;j<(*num_names);j++) sid_compose(&(*sid_mem)[j], &domain->sid, rid_mem[j]); diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index bb1aa04bfa..e911487324 100644 --- a/source3/winbindd/winbindd_rpc.c +++ b/source3/winbindd/winbindd_rpc.c @@ -644,7 +644,7 @@ NTSTATUS rpc_lookup_useraliases(TALLOC_CTX *mem_ctx, num_queries, num_query_sids)); if (num_query_sids) { - sid_array.sids = TALLOC_ZERO_ARRAY(mem_ctx, struct lsa_SidPtr, num_query_sids); + sid_array.sids = talloc_zero_array(mem_ctx, struct lsa_SidPtr, num_query_sids); if (sid_array.sids == NULL) { return NT_STATUS_NO_MEMORY; } @@ -839,9 +839,9 @@ NTSTATUS rpc_lookup_groupmem(TALLOC_CTX *mem_ctx, * Step #2: Convert list of rids into list of usernames. */ if (num_names > 0) { - names = TALLOC_ZERO_ARRAY(mem_ctx, char *, num_names); - name_types = TALLOC_ZERO_ARRAY(mem_ctx, uint32_t, num_names); - sid_mem = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_names); + names = talloc_zero_array(mem_ctx, char *, num_names); + name_types = talloc_zero_array(mem_ctx, uint32_t, num_names); + sid_mem = talloc_zero_array(mem_ctx, struct dom_sid, num_names); if (names == NULL || name_types == NULL || sid_mem == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/winbindd/winbindd_sids_to_xids.c b/source3/winbindd/winbindd_sids_to_xids.c index 203ccfce09..f6e2d82cce 100644 --- a/source3/winbindd/winbindd_sids_to_xids.c +++ b/source3/winbindd/winbindd_sids_to_xids.c @@ -80,7 +80,7 @@ struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx, DEBUG(10, ("num_sids: %d\n", (int)state->num_sids)); - state->cached = TALLOC_ZERO_ARRAY(state, struct id_map, + state->cached = talloc_zero_array(state, struct id_map, state->num_sids); if (tevent_req_nomem(state->cached, req)) { return tevent_req_post(req, ev); |