From 5cae7da1de302b38ee0059590b1e93a3d60ee42c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Feb 2018 12:07:11 +0100 Subject: s3:cli_lsarpc: use talloc_zero_array() in dcerpc_lsa_lookup_sids_generic() It just feels better for such a complex function. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13281 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme Reviewed-by: Andreas Schneider --- source3/rpc_client/cli_lsarpc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/rpc_client/cli_lsarpc.c') diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 65c6ca04d50..1dce7056385 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -370,19 +370,22 @@ NTSTATUS dcerpc_lsa_lookup_sids_generic(struct dcerpc_binding_handle *h, bool have_unmapped = false; if (num_sids) { - if (!(domains = talloc_array(mem_ctx, char *, num_sids))) { + domains = talloc_zero_array(mem_ctx, char *, num_sids); + if (domains == NULL) { DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n")); status = NT_STATUS_NO_MEMORY; goto fail; } - if (!(names = talloc_array(mem_ctx, char *, num_sids))) { + names = talloc_zero_array(mem_ctx, char *, num_sids); + if (names == NULL) { DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n")); status = NT_STATUS_NO_MEMORY; goto fail; } - if (!(types = talloc_array(mem_ctx, enum lsa_SidType, num_sids))) { + types = talloc_zero_array(mem_ctx, enum lsa_SidType, num_sids); + if (types == NULL) { DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n")); status = NT_STATUS_NO_MEMORY; goto fail; -- cgit v1.2.1