summaryrefslogtreecommitdiff
path: root/src/bus-driverd
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-04 09:20:51 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-04 10:04:50 -0500
commit6e18964d3a365567954fe10ddcfad74babdc427c (patch)
treea1e62c233e0cac0224623049e6fb98b8e450d0ac /src/bus-driverd
parente062dec5ae1a443d47885537af85d328c83c67db (diff)
Introduce strv_consume which takes ownership
This mirrors set_consume and makes the common use a bit nicer.
Diffstat (limited to 'src/bus-driverd')
-rw-r--r--src/bus-driverd/bus-driverd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/bus-driverd/bus-driverd.c b/src/bus-driverd/bus-driverd.c
index 54059604b1..3284d62534 100644
--- a/src/bus-driverd/bus-driverd.c
+++ b/src/bus-driverd/bus-driverd.c
@@ -562,11 +562,9 @@ static int driver_list_queued_owners(sd_bus *bus, sd_bus_message *m, void *userd
if (asprintf(&n, ":1.%llu", (unsigned long long) name->owner_id) < 0)
return -ENOMEM;
- r = strv_push(&owners, n);
- if (r < 0) {
- free(n);
- return -ENOMEM;
- }
+ r = strv_consume(&owners, n);
+ if (r < 0)
+ return r;
}
r = ioctl(bus->input_fd, KDBUS_CMD_FREE, &cmd.offset);