]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
polkit: use LIST_POP where appropriate
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Aug 2023 08:51:19 +0000 (10:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 9 Aug 2023 09:02:51 +0000 (11:02 +0200)
src/shared/bus-polkit.c

index b7f7c2b47aaa088a79b66f783368ed58a8ad238d..383ebd9edef899806e4a7ea56c68f89d0ebf0139 100644 (file)
@@ -220,10 +220,8 @@ static AsyncPolkitQuery *async_polkit_query_free(AsyncPolkitQuery *q) {
 
         sd_event_source_disable_unref(q->defer_event_source);
 
-        while ((a = q->authorized_actions)) {
-                LIST_REMOVE(authorized, q->authorized_actions, a);
+        while ((a = LIST_POP(authorized, q->authorized_actions)))
                 async_polkit_query_action_free(a);
-        }
 
         async_polkit_query_action_free(q->denied_action);
         async_polkit_query_action_free(q->error_action);