1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

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>
This commit is contained in:
Stefan Metzmacher
2018-02-02 12:07:11 +01:00
committed by Ralph Boehme
parent 5cae7da1de
commit 569c910b95

View File

@ -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;