1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

resolve: use structured initialization and use new() instead of new0()

This commit is contained in:
Yu Watanabe 2018-07-26 17:43:09 +09:00
parent c0df8f834a
commit 52588e0bda

View File

@ -112,13 +112,15 @@ static int add_item(Manager *m, int family, const union in_addr_union *address,
if (r < 0)
return log_oom();
item = new0(EtcHostsItem, 1);
item = new(EtcHostsItem, 1);
if (!item)
return log_oom();
item->family = family;
item->address = *address;
item->names = names;
*item = (EtcHostsItem) {
.family = family,
.address = *address,
.names = names,
};
r = set_put(m->etc_hosts_by_address, item);
if (r < 0) {