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

index b2fd087987bc48579d3443e4a1e33d59bb366660..6715f72d340d4eb9410c0f7f68357ed133edce60 100644 (file)
@@ -136,12 +136,14 @@ _public_ int sd_ndisc_new(sd_ndisc **ret) {
 
         assert_return(ret, -EINVAL);
 
-        nd = new0(sd_ndisc, 1);
+        nd = new(sd_ndisc, 1);
         if (!nd)
                 return -ENOMEM;
 
-        nd->n_ref = 1;
-        nd->fd = -1;
+        *nd = (sd_ndisc) {
+                .n_ref = 1,
+                .fd = -1,
+        };
 
         *ret = TAKE_PTR(nd);