diff options
author | Tom Gundersen <teg@jklm.no> | 2014-08-19 15:41:23 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-08-19 15:41:23 +0200 |
commit | 2c36be2f4ba38f9097cdcdcd1e724ffa46da12c7 (patch) | |
tree | 25ba47b3eee02fcd9c93334e14f3616eca506c59 /src/network | |
parent | 93aef81600437b96c96c6ca32ce85df32631c351 (diff) |
networkd: fix use-after-free
Elements must be removed from the hashtable before they are freed.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-network.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 803fcdd609..fc62395217 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -172,8 +172,10 @@ void network_free(Network *network) { netdev_unref(network->bond); - HASHMAP_FOREACH(netdev, network->stacked_netdevs, i) + HASHMAP_FOREACH(netdev, network->stacked_netdevs, i) { + hashmap_remove(network->stacked_netdevs, netdev->ifname); netdev_unref(netdev); + } hashmap_free(network->stacked_netdevs); while ((route = network->static_routes)) |