]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/systemctl/systemctl-list-unit-files.c
systemctl: reduce scope of iterator variables
[thirdparty/systemd.git] / src / systemctl / systemctl-list-unit-files.c
index e1bf8766205b1fa4710079d037a299aa0c7f2b19..6da2914eff1b0a355f60f66adecb884faaa5157b 100644 (file)
@@ -136,7 +136,6 @@ static int output_unit_file_list(const UnitFileList *units, unsigned c) {
 int list_unit_files(int argc, char *argv[], void *userdata) {
         _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
         _cleanup_free_ UnitFileList *units = NULL;
-        UnitFileList *unit;
         size_t size = 0;
         unsigned c = 0;
         const char *state;
@@ -265,7 +264,7 @@ int list_unit_files(int argc, char *argv[], void *userdata) {
                 return r;
 
         if (install_client_side())
-                for (unit = units; unit < units + c; unit++)
+                for (UnitFileList *unit = units; unit < units + c; unit++)
                         free(unit->path);
 
         if (c == 0)