From: Yu Watanabe Date: Sat, 3 Nov 2018 06:44:34 +0000 (+0900) Subject: network: fix memleak abot Address.label X-Git-Tag: v240~414^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de4224aa224d0138635091188ea6e5c91058f8f3;p=thirdparty%2Fsystemd.git network: fix memleak abot Address.label Also fix possible memleak about Address.section. Fixes #10628. --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index cf33563bdd6..2041100e5ea 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -91,10 +91,8 @@ void address_free(Address *address) { assert(address->network->n_static_addresses > 0); address->network->n_static_addresses--; - if (address->section) { + if (address->section) hashmap_remove(address->network->addresses_by_section, address->section); - network_config_section_free(address->section); - } } if (address->link) { @@ -105,6 +103,8 @@ void address_free(Address *address) { memzero(&address->link->ipv6ll_address, sizeof(struct in6_addr)); } + network_config_section_free(address->section); + free(address->label); free(address); }