summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r--src/network/networkd-network.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 90d86f35a9..f6d02fb274 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -306,7 +306,7 @@ int network_verify(Network *network) {
LIST_FOREACH_SAFE(prefixes, prefix, prefix_next, network->static_route_prefixes)
if (section_is_invalid(prefix->section))
- prefix_free(prefix);
+ route_prefix_free(prefix);
LIST_FOREACH_SAFE(rules, rule, rule_next, network->rules)
if (routing_policy_rule_section_verify(rule) < 0)
@@ -654,6 +654,9 @@ static Network *network_free(Network *network) {
while ((prefix = network->static_prefixes))
prefix_free(prefix);
+ while ((prefix = network->static_route_prefixes))
+ route_prefix_free(prefix);
+
while ((rule = network->rules))
routing_policy_rule_free(rule);
@@ -664,6 +667,7 @@ static Network *network_free(Network *network) {
hashmap_free(network->neighbors_by_section);
hashmap_free(network->address_labels_by_section);
hashmap_free(network->prefixes_by_section);
+ hashmap_free(network->route_prefixes_by_section);
hashmap_free(network->rules_by_section);
ordered_hashmap_free_with_destructor(network->qdiscs_by_section, qdisc_free);