summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-01-23 23:52:37 +0100
committerRalph Boehme <slow@samba.org>2018-02-21 14:19:17 +0100
commitc376ab29d1d9f4b06fbb3a713029d79ecac80b59 (patch)
treed747f0be1f7dd4741e89f9d643fc5a3fdf383dd2
parent569c910b950df24b22777c545fe9f6427a19b035 (diff)
downloadsamba-c376ab29d1d9f4b06fbb3a713029d79ecac80b59.tar.gz
winbindd: make use of talloc_zero_array() in wb_lookupsids*()
It just feels better for such a complex function. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13281 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--source3/winbindd/wb_lookupsids.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/winbindd/wb_lookupsids.c b/source3/winbindd/wb_lookupsids.c
index bd90c43bbe9..af02a0c9547 100644
--- a/source3/winbindd/wb_lookupsids.c
+++ b/source3/winbindd/wb_lookupsids.c
@@ -124,7 +124,7 @@ struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
state->sids = sids;
state->num_sids = num_sids;
- state->single_sids = talloc_array(state, uint32_t, num_sids);
+ state->single_sids = talloc_zero_array(state, uint32_t, num_sids);
if (tevent_req_nomem(state->single_sids, req)) {
return tevent_req_post(req, ev);
}
@@ -133,7 +133,7 @@ struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
if (tevent_req_nomem(state->res_domains, req)) {
return tevent_req_post(req, ev);
}
- state->res_domains->domains = talloc_array(
+ state->res_domains->domains = talloc_zero_array(
state->res_domains, struct lsa_DomainInfo, num_sids);
if (tevent_req_nomem(state->res_domains->domains, req)) {
return tevent_req_post(req, ev);
@@ -143,7 +143,7 @@ struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
if (tevent_req_nomem(state->res_names, req)) {
return tevent_req_post(req, ev);
}
- state->res_names->names = talloc_array(
+ state->res_names->names = talloc_zero_array(
state->res_names, struct lsa_TranslatedName, num_sids);
if (tevent_req_nomem(state->res_names->names, req)) {
return tevent_req_post(req, ev);
@@ -371,13 +371,13 @@ static struct wb_lookupsids_domain *wb_lookupsids_get_domain(
domain = &domains[num_domains];
domain->domain = wb_domain;
- domain->sids.sids = talloc_array(domains, struct lsa_SidPtr, num_sids);
+ domain->sids.sids = talloc_zero_array(domains, struct lsa_SidPtr, num_sids);
if (domains->sids.sids == NULL) {
goto fail;
}
domain->sids.num_sids = 0;
- domain->sid_indexes = talloc_array(domains, uint32_t, num_sids);
+ domain->sid_indexes = talloc_zero_array(domains, uint32_t, num_sids);
if (domain->sid_indexes == NULL) {
TALLOC_FREE(domain->sids.sids);
goto fail;