network: radv - use hashmap_ensure_put

This commit is contained in:
Susant Sahani
2021-01-18 21:34:46 +01:00
parent d1ce835989
commit b2cb2e82c8
+1 -5
View File
@@ -143,11 +143,7 @@ static int route_prefix_new_static(Network *network, const char *filename, unsig
prefix->network = network;
prefix->section = TAKE_PTR(n);
r = hashmap_ensure_allocated(&network->route_prefixes_by_section, &network_config_hash_ops);
if (r < 0)
return r;
r = hashmap_put(network->route_prefixes_by_section, prefix->section, prefix);
r = hashmap_ensure_put(&network->route_prefixes_by_section, &network_config_hash_ops, prefix->section, prefix);
if (r < 0)
return r;