]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp6-client: use structured initializer
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 6 Feb 2022 09:24:13 +0000 (18:24 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Feb 2022 05:43:45 +0000 (14:43 +0900)
src/libsystemd-network/sd-dhcp6-lease.c

index c2d076d3b9cdc0af6328820500e9e3ba2d14e3c0..e323fd3923cc0d924834b909f94a1f8a117b4ad7 100644 (file)
@@ -460,11 +460,13 @@ int dhcp6_lease_new(sd_dhcp6_lease **ret) {
 
         assert(ret);
 
-        lease = new0(sd_dhcp6_lease, 1);
+        lease = new(sd_dhcp6_lease, 1);
         if (!lease)
                 return -ENOMEM;
 
-        lease->n_ref = 1;
+        *lease = (sd_dhcp6_lease) {
+                .n_ref = 1,
+        };
 
         *ret = lease;
         return 0;