diff options
author | Susant Sahani <ssahani@vmware.com> | 2021-01-14 06:28:04 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@gmail.com> | 2021-01-15 14:29:42 +0100 |
commit | fb8ac4cf3e19d8633cdc8c0315d4e219f7167295 (patch) | |
tree | d5e5c031a1d648b3d1af922ad7262a1d204396e6 /src | |
parent | b77071b8989bd7859804087711fa37ca23b0027b (diff) | |
download | systemd-fb8ac4cf3e19d8633cdc8c0315d4e219f7167295.tar.gz |
network: address label - use hashmap_ensure_put
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-address-label.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/network/networkd-address-label.c b/src/network/networkd-address-label.c index f933a1da94..7f756cfe40 100644 --- a/src/network/networkd-address-label.c +++ b/src/network/networkd-address-label.c @@ -55,11 +55,7 @@ static int address_label_new_static(Network *network, const char *filename, unsi .section = TAKE_PTR(n), }; - r = hashmap_ensure_allocated(&network->address_labels_by_section, &network_config_hash_ops); - if (r < 0) - return r; - - r = hashmap_put(network->address_labels_by_section, label->section, label); + r = hashmap_ensure_put(&network->address_labels_by_section, &network_config_hash_ops, label->section, label); if (r < 0) return r; |