network: radv - use hashmap_ensure_put
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user