diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-12 07:24:11 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-12 08:32:11 +0100 |
commit | 3e5700428e768438bb1083e004be23201ede4e08 (patch) | |
tree | ca5bae7b03fe762e2c78c82b45140651c2a1c1b6 /src/network/networkd-address-label.c | |
parent | network: do not assign unused value (diff) | |
download | systemd-3e5700428e768438bb1083e004be23201ede4e08.tar.xz systemd-3e5700428e768438bb1083e004be23201ede4e08.zip |
network: allocate hashmap objects when they are required
Diffstat (limited to 'src/network/networkd-address-label.c')
-rw-r--r-- | src/network/networkd-address-label.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/networkd-address-label.c b/src/network/networkd-address-label.c index 1392cba538..691bbf4761 100644 --- a/src/network/networkd-address-label.c +++ b/src/network/networkd-address-label.c @@ -65,6 +65,10 @@ static int address_label_new_static(Network *network, const char *filename, unsi if (filename) { label->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); if (r < 0) return r; |