summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-11-02 10:17:24 +0100
committerDaniel Mack <github@zonque.org>2015-11-02 10:17:24 +0100
commitfba397e2af4aebb11ec600a862e604d9d70bfc29 (patch)
treedf18102213a74446dbbd2f14af8e45f22b4e7300 /src
parentec8c6b19da0bc38b19664fb78657a978655132ef (diff)
parent4701725cd58bc75a287ba050c8ad69a457b68d5d (diff)
Merge pull request #1711 from mustrumr/network-use-after-free
network: fix use-after-free in link_free
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index dcc2569660..12ca02868d 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -349,12 +349,12 @@ static void link_free(Link *link) {
while (!set_isempty(link->addresses))
address_free(set_first(link->addresses));
- set_free(link->addresses);
-
while (!set_isempty(link->addresses_foreign))
address_free(set_first(link->addresses_foreign));
- set_free(link->addresses_foreign);
+ link->addresses = set_free(link->addresses);
+
+ link->addresses_foreign = set_free(link->addresses_foreign);
while ((address = link->pool_addresses)) {
LIST_REMOVE(addresses, link->pool_addresses, address);