diff options
author | David Tardon <dtardon@redhat.com> | 2023-08-14 16:07:46 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2023-08-17 09:48:17 +0200 |
commit | 9aad490e53888c39434f668df833e0e179f144b0 (patch) | |
tree | c12125c7131abbe30b62bcec5a2fb15c9050ab47 /src/network | |
parent | list: add LIST_CLEAR() helper that empties the list (diff) | |
download | systemd-9aad490e53888c39434f668df833e0e179f144b0.tar.xz systemd-9aad490e53888c39434f668df833e0e179f144b0.zip |
tree-wide: use LIST_CLEAR()
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/netdev/wireguard.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c index ffc6452bbf..0e992f9ad1 100644 --- a/src/network/netdev/wireguard.c +++ b/src/network/netdev/wireguard.c @@ -35,14 +35,9 @@ static void wireguard_resolve_endpoints(NetDev *netdev); static int peer_resolve_endpoint(WireguardPeer *peer); static void wireguard_peer_clear_ipmasks(WireguardPeer *peer) { - WireguardIPmask *mask; - assert(peer); - while ((mask = peer->ipmasks)) { - LIST_REMOVE(ipmasks, peer->ipmasks, mask); - free(mask); - } + LIST_CLEAR(ipmasks, peer->ipmasks, free); } static WireguardPeer* wireguard_peer_free(WireguardPeer *peer) { |