diff options
author | Luca Boccassi <bluca@debian.org> | 2023-08-17 17:27:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 17:27:43 +0200 |
commit | f1a621b09bc4881e9e3d68f12ee68cb537b29b56 (patch) | |
tree | 13bbbccaf4037dd9c72354bb33b438ed871d348c /src/shared/bus-polkit.c | |
parent | Merge pull request #28869 from DaanDeMeyer/repart-trailing (diff) | |
parent | open-file: add missing assert (diff) | |
download | systemd-f1a621b09bc4881e9e3d68f12ee68cb537b29b56.tar.xz systemd-f1a621b09bc4881e9e3d68f12ee68cb537b29b56.zip |
Merge pull request #28832 from dtardon/list-clear
Add LIST_CLEAR() helper that empties the list
Diffstat (limited to 'src/shared/bus-polkit.c')
-rw-r--r-- | src/shared/bus-polkit.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/shared/bus-polkit.c b/src/shared/bus-polkit.c index b9ea8aa7da..3ff2726d4a 100644 --- a/src/shared/bus-polkit.c +++ b/src/shared/bus-polkit.c @@ -204,8 +204,6 @@ typedef struct AsyncPolkitQuery { } AsyncPolkitQuery; static AsyncPolkitQuery *async_polkit_query_free(AsyncPolkitQuery *q) { - AsyncPolkitQueryAction *a; - if (!q) return NULL; @@ -220,8 +218,7 @@ static AsyncPolkitQuery *async_polkit_query_free(AsyncPolkitQuery *q) { sd_event_source_disable_unref(q->defer_event_source); - while ((a = LIST_POP(authorized, q->authorized_actions))) - async_polkit_query_action_free(a); + LIST_CLEAR(authorized, q->authorized_actions, async_polkit_query_action_free); async_polkit_query_action_free(q->denied_action); async_polkit_query_action_free(q->error_action); |