1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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

View File

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