smbd: Avoid a ZERO_STRUCT() with direct struct initialization
authorVolker Lendecke <vl@samba.org>
Mon, 19 Feb 2024 08:57:16 +0000 (09:57 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 12 Mar 2024 14:33:14 +0000 (14:33 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar 12 14:33:14 UTC 2024 on atb-devel-224

source3/lib/ctdbd_conn.c

index 9f8dce684bcddb2c9938d048bd5aad779664094a..f32397d9353b9e4423e9dd7833e9d61a4cb06d18 100644 (file)
@@ -1291,7 +1291,7 @@ void ctdbd_unregister_ips(struct ctdbd_connection *conn,
                                    void *private_data),
                          void *private_data)
 {
-       struct ctdb_connection p;
+       struct ctdb_connection p = {};
        TDB_DATA data = { .dptr = (uint8_t *)&p, .dsize = sizeof(p) };
        int ret;
        struct sockaddr_storage client;
@@ -1304,7 +1304,6 @@ void ctdbd_unregister_ips(struct ctdbd_connection *conn,
        smbd_ctdb_canonicalize_ip(_client, &client);
        smbd_ctdb_canonicalize_ip(_server, &server);
 
-       ZERO_STRUCT(p);
        switch (client.ss_family) {
        case AF_INET:
                memcpy(&p.dst.ip, &server, sizeof(p.dst.ip));