mirror of
https://github.com/samba-team/samba.git
synced 2025-01-31 01:48:16 +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> (cherry picked from commit 569c910b950df24b22777c545fe9f6427a19b035)
This commit is contained in:
parent
00b55da688
commit
d90f8fee5d
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user