summaryrefslogtreecommitdiff
path: root/source3/rpc_client
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
commit569c910b950df24b22777c545fe9f6427a19b035 (patch)
tree87dabb38867d0005f229b79c8b42d195ded6fbb0 /source3/rpc_client
parent5cae7da1de302b38ee0059590b1e93a3d60ee42c (diff)
downloadsamba-569c910b950df24b22777c545fe9f6427a19b035.tar.gz
s3:cli_lsarpc: use talloc_zero_array() in dcerpc_lsa_lookup_names_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')
-rw-r--r--source3/rpc_client/cli_lsarpc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 1dce7056385..a093ee2572c 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -638,20 +638,22 @@ NTSTATUS dcerpc_lsa_lookup_names_generic(struct dcerpc_binding_handle *h,
}
if (num_names) {
- if (!((*sids = talloc_array(mem_ctx, struct dom_sid, num_names)))) {
+ *sids = talloc_zero_array(mem_ctx, struct dom_sid, num_names);
+ if (*sids == NULL) {
DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n"));
*presult = NT_STATUS_NO_MEMORY;
goto done;
}
- if (!((*types = talloc_array(mem_ctx, enum lsa_SidType, num_names)))) {
+ *types = talloc_zero_array(mem_ctx, enum lsa_SidType, num_names);
+ if (*types == NULL) {
DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n"));
*presult = NT_STATUS_NO_MEMORY;
goto done;
}
if (dom_names != NULL) {
- *dom_names = talloc_array(mem_ctx, const char *, num_names);
+ *dom_names = talloc_zero_array(mem_ctx, const char *, num_names);
if (*dom_names == NULL) {
DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n"));
*presult = NT_STATUS_NO_MEMORY;