From: Yu Watanabe Date: Fri, 9 Nov 2018 02:43:50 +0000 (+0900) Subject: network: fix potential segfault in network_free() X-Git-Tag: v240~376^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e512c6c1aae4f0fed81eb04eb35f3d6600ab1181;p=thirdparty%2Fsystemd.git network: fix potential segfault in network_free() --- diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 4eb553125b3..bf910956cb2 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -413,7 +413,7 @@ void network_free(Network *network) { if (network->manager->networks) LIST_REMOVE(networks, network->manager->networks, network); - if (network->manager->networks_by_name) + if (network->manager->networks_by_name && network->name) hashmap_remove(network->manager->networks_by_name, network->name); if (network->manager->duids_requesting_uuid)