]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ipv4acd: use structured initializer at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Nov 2018 05:17:20 +0000 (14:17 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Nov 2018 13:57:42 +0000 (22:57 +0900)
src/libsystemd-network/sd-ipv4acd.c

index 6c12b5144e92f076efa0174bf6a9a15bcf439f3c..b9081a4a43661ec0757109f79e1279fe4dac2bfe 100644 (file)
@@ -113,14 +113,16 @@ int sd_ipv4acd_new(sd_ipv4acd **ret) {
 
         assert_return(ret, -EINVAL);
 
-        acd = new0(sd_ipv4acd, 1);
+        acd = new(sd_ipv4acd, 1);
         if (!acd)
                 return -ENOMEM;
 
-        acd->n_ref = 1;
-        acd->state = IPV4ACD_STATE_INIT;
-        acd->ifindex = -1;
-        acd->fd = -1;
+        *acd = (sd_ipv4acd) {
+                .n_ref = 1,
+                .state = IPV4ACD_STATE_INIT,
+                .ifindex = -1,
+                .fd = -1,
+        };
 
         *ret = TAKE_PTR(acd);