From 4d3c339c8259fd94c4aa7c1f30b5ad1a900832f3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 22 Oct 2024 13:43:23 +0200 Subject: [PATCH] libads: Simplify cldap_multi_netlogon_send() Save a few lines with a struct initialization Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/libads/cldap.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c index 56c2537ffa9..66c97690208 100644 --- a/source3/libads/cldap.c +++ b/source3/libads/cldap.c @@ -157,9 +157,9 @@ struct tevent_req *cldap_multi_netlogon_send( return tevent_req_post(req, ev); } - state->ios = talloc_zero_array(state->responses, - struct cldap_netlogon, - num_servers); + state->ios = talloc_array(state->responses, + struct cldap_netlogon, + num_servers); if (tevent_req_nomem(state->ios, req)) { return tevent_req_post(req, ev); } @@ -188,16 +188,8 @@ struct tevent_req *cldap_multi_netlogon_send( nt_errstr(status)); } - state->ios[i].in.dest_address = NULL; - state->ios[i].in.dest_port = 0; - state->ios[i].in.realm = domain; - state->ios[i].in.host = NULL; - state->ios[i].in.user = NULL; - state->ios[i].in.domain_guid = NULL; - state->ios[i].in.domain_sid = NULL; - state->ios[i].in.acct_control = 0; - state->ios[i].in.version = ntversion; - state->ios[i].in.map_response = false; + state->ios[i] = (struct cldap_netlogon){ + .in.realm = domain, .in.version = ntversion}; } for (i=0; i