diff options
author | Susant Sahani <ssahani@redhat.com> | 2016-04-25 12:38:56 +0530 |
---|---|---|
committer | Susant Sahani <ssahani@redhat.com> | 2016-04-25 12:38:56 +0530 |
commit | 5215524dbe4d64ddbfdce52ca9d1b24b7d34dc5b (patch) | |
tree | 2fbd189b80ff97c71fb55963cf20ed6d98d1f256 /src/network | |
parent | cacc1dbf17e839a8a10ee3c43c2bb2bf8bda7642 (diff) |
networkd: Address- initialize the node before adding to list.
It make more sense to initalize the node first then
we add to the list.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-address.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 7f9a7268cc..429319da6b 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -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; |