network: add one more section validty check
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 19 Sep 2019 06:20:00 +0000 (15:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 21 Sep 2019 11:17:15 +0000 (20:17 +0900)
Follow-up for 203d4df5732b1fdcf50db498ddeb74a934b21f87.

src/network/networkd-network.c

index d1c4cdd..a2cd7f4 100644 (file)
@@ -300,6 +300,10 @@ int network_verify(Network *network) {
                 if (section_is_invalid(prefix->section))
                         prefix_free(prefix);
 
+        LIST_FOREACH_SAFE(prefixes, prefix, prefix_next, network->static_route_prefixes)
+                if (section_is_invalid(prefix->section))
+                        prefix_free(prefix);
+
         LIST_FOREACH_SAFE(rules, rule, rule_next, network->rules)
                 if (routing_policy_rule_section_verify(rule) < 0)
                         routing_policy_rule_free(rule);