From: Yu Watanabe Date: Fri, 22 Dec 2023 16:21:22 +0000 (+0900) Subject: network/address: also drop reference for DHCP server address X-Git-Tag: v256-rc1~1380^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ae3a4f5e282a1fb024e7bb5d6cf1b83037a2395;p=thirdparty%2Fsystemd.git network/address: also drop reference for DHCP server address The Address object should never freed after it is referenced. So, this should not change any behavior. Just for safety. --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index bcd3ae66213..629c4d697f9 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -201,6 +201,9 @@ Address *address_free(Address *address) { if (address->network) { assert(address->section); ordered_hashmap_remove(address->network->addresses_by_section, address->section); + + if (address->network->dhcp_server_address == address) + address->network->dhcp_server_address = NULL; } if (address->link) {