]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libads: Simplify cldap_multi_netlogon_send()
authorVolker Lendecke <vl@samba.org>
Tue, 22 Oct 2024 11:43:23 +0000 (13:43 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 25 Oct 2024 07:55:34 +0000 (07:55 +0000)
Save a few lines with a struct initialization

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libads/cldap.c

index 56c2537ffa985d736dbe8129078932b642bc585a..66c97690208733745cf059d36ac222029ae499b8 100644 (file)
@@ -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<min_servers; i++) {