From: Yu Watanabe Date: Tue, 5 Nov 2019 00:39:44 +0000 (+0900) Subject: network: fix memleak X-Git-Tag: v244-rc1~95^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9be6ae775fb303deb49ee8e4c5013ce98dc48b93;p=thirdparty%2Fsystemd.git network: fix memleak --- diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 5e82b3c5e08..f6d02fb2749 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -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);