]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: use structured initialization for DnsServer allocation
authorLennart Poettering <lennart@poettering.net>
Tue, 4 Dec 2018 19:24:26 +0000 (20:24 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 7 Dec 2018 16:16:29 +0000 (17:16 +0100)
src/resolve/resolved-dns-server.c

index e05ada29a883fdbf9c2cfbd2165d6020e07d6a01..c7f9de2cbd9a3b34d54043d88c303d5bcc6a5feb 100644 (file)
@@ -43,16 +43,18 @@ int dns_server_new(
                         return -E2BIG;
         }
 
-        s = new0(DnsServer, 1);
+        s = new(DnsServer, 1);
         if (!s)
                 return -ENOMEM;
 
-        s->n_ref = 1;
-        s->manager = m;
-        s->type = type;
-        s->family = family;
-        s->address = *in_addr;
-        s->ifindex = ifindex;
+        *s = (DnsServer) {
+                .n_ref = 1,
+                .manager = m,
+                .type = type,
+                .family = family,
+                .address = *in_addr,
+                .ifindex = ifindex,
+        };
 
         dns_server_reset_features(s);