]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/bus-polkit.c
strv: make iterator in STRV_FOREACH() declaread in the loop
[thirdparty/systemd.git] / src / shared / bus-polkit.c
index 0722b1a118b25864ccf10ffb7329bec80efb2f05..4d733a81737a09448bda7bcb6932d1960f648835 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "bus-internal.h"
 #include "bus-message.h"
@@ -36,7 +36,6 @@ static int bus_message_append_strv_key_value(
                 sd_bus_message *m,
                 const char **l) {
 
-        const char **k, **v;
         int r;
 
         assert(m);
@@ -408,8 +407,11 @@ int bus_verify_polkit_async(
         return -EACCES;
 }
 
-void bus_verify_polkit_async_registry_free(Hashmap *registry) {
+Hashmap *bus_verify_polkit_async_registry_free(Hashmap *registry) {
 #if ENABLE_POLKIT
-        hashmap_free_with_destructor(registry, async_polkit_query_free);
+        return hashmap_free_with_destructor(registry, async_polkit_query_free);
+#else
+        assert(hashmap_isempty(registry));
+        return hashmap_free(registry);
 #endif
 }