chiark / gitweb /
Unify GREEDY_REALLOC and GREEDY_REALLOC_T
[elogind.git] / src / systemctl / systemctl.c
index 653a3247b414634480659e5c92a9ac6898b5025b..8fd7bc9608476381dbe826f0fd3b79f10ae6e88a 100644 (file)
@@ -515,7 +515,7 @@ static int get_unit_list(
 
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        size_t size;
+        size_t size = c;
         int r;
         UnitInfo u;
 
@@ -523,8 +523,6 @@ static int get_unit_list(
         assert(unit_infos);
         assert(_reply);
 
-        size = sizeof(UnitInfo) * c;
-
         r = sd_bus_call_method(
                         bus,
                         "org.freedesktop.systemd1",