]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: fix potential segfault in network_free()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 9 Nov 2018 02:43:50 +0000 (11:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 9 Nov 2018 02:45:12 +0000 (11:45 +0900)
src/network/networkd-network.c

index 4eb553125b3a7c0395b3803be3071e5d68782e44..bf910956cb267f14ee40f1cd2ffc9242c7df10eb 100644 (file)
@@ -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)