From: Lennart Poettering Date: Tue, 4 Dec 2018 19:24:26 +0000 (+0100) Subject: resolved: use structured initialization for DnsServer allocation X-Git-Tag: v240~111^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65b0179a25c6408f218912cd804403170d43fd38;p=thirdparty%2Fsystemd.git resolved: use structured initialization for DnsServer allocation --- diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c index e05ada29a88..c7f9de2cbd9 100644 --- a/src/resolve/resolved-dns-server.c +++ b/src/resolve/resolved-dns-server.c @@ -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);