summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_lsarpc.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-02-02 12:07:11 +0100
committerRalph Boehme <slow@samba.org>2018-02-21 14:19:17 +0100
commit5cae7da1de302b38ee0059590b1e93a3d60ee42c (patch)
tree899a70571be8fddccee4ecb43f6b953652063dd4 /source3/rpc_client/cli_lsarpc.c
parentb5ffa0e21f74fa0c452df38cf50e542eb278562d (diff)
downloadsamba-5cae7da1de302b38ee0059590b1e93a3d60ee42c.tar.gz
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 <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/rpc_client/cli_lsarpc.c')
-rw-r--r--source3/rpc_client/cli_lsarpc.c9
1 files changed, 6 insertions, 3 deletions
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;