networkd: Address- initialize the node before adding to list.

It make more sense to initalize the node first then
we add to the list.
This commit is contained in:
Susant Sahani
2016-04-25 12:38:56 +05:30
parent cacc1dbf17
commit 5215524dbe
+3 -4
View File
@@ -67,16 +67,15 @@ int address_new_static(Network *network, unsigned section, Address **ret) {
if (r < 0)
return r;
address->network = network;
LIST_APPEND(addresses, network->static_addresses, address);
if (section) {
address->section = section;
hashmap_put(network->addresses_by_section,
UINT_TO_PTR(address->section), address);
}
address->network = network;
LIST_APPEND(addresses, network->static_addresses, address);
*ret = address;
address = NULL;