1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

network: address - use ordered_hashmap_ensure_put

This commit is contained in:
Susant Sahani 2021-01-18 21:09:27 +01:00
parent 9d6bb21f37
commit 28d9587be5

View File

@ -94,11 +94,7 @@ static int address_new_static(Network *network, const char *filename, unsigned s
address->network = network;
address->section = TAKE_PTR(n);
r = ordered_hashmap_ensure_allocated(&network->addresses_by_section, &network_config_hash_ops);
if (r < 0)
return r;
r = ordered_hashmap_put(network->addresses_by_section, address->section, address);
r = ordered_hashmap_ensure_put(&network->addresses_by_section, &network_config_hash_ops, address->section, address);
if (r < 0)
return r;