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/nspawn/nspawn-expose-ports.c | |
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/nspawn/nspawn-expose-ports.c')
-rw-r--r-- | src/nspawn/nspawn-expose-ports.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/nspawn/nspawn-expose-ports.c b/src/nspawn/nspawn-expose-ports.c index b35f8b6a9b..5644068446 100644 --- a/src/nspawn/nspawn-expose-ports.c +++ b/src/nspawn/nspawn-expose-ports.c @@ -73,12 +73,7 @@ int expose_port_parse(ExposePort **l, const char *s) { } void expose_port_free_all(ExposePort *p) { - - while (p) { - ExposePort *q = p; - LIST_REMOVE(ports, p, q); - free(q); - } + LIST_CLEAR(ports, p, free); } int expose_port_flush(FirewallContext **fw_ctx, ExposePort* l, int af, union in_addr_union *exposed) { |