summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/bus-control.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index 22b95d589d..db0c11b0fe 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -237,11 +237,9 @@ static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) {
if (asprintf(&n, ":1.%llu", (unsigned long long) name->owner_id) < 0)
return -ENOMEM;
- r = strv_push(x, n);
- if (r < 0) {
- free(n);
- return -ENOMEM;
- }
+ r = strv_consume(x, n);
+ if (r < 0)
+ return r;
previous_id = name->owner_id;
}