summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-control.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus/bus-control.c')
-rw-r--r--src/libsystemd-bus/bus-control.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c
index b1172899d0..186724e8ad 100644
--- a/src/libsystemd-bus/bus-control.c
+++ b/src/libsystemd-bus/bus-control.c
@@ -504,14 +504,11 @@ static int bus_get_owner_kdbus(
}
break;
- case KDBUS_ITEM_NAMES:
+ case KDBUS_ITEM_NAME:
if (mask & SD_BUS_CREDS_WELL_KNOWN_NAMES) {
- c->well_known_names_size = item->size - KDBUS_PART_HEADER_SIZE;
- c->well_known_names = memdup(item->data, c->well_known_names_size);
- if (!c->well_known_names) {
- r = -ENOMEM;
+ r = strv_extend(&c->well_known_names, item->name.name);
+ if (r < 0)
goto fail;
- }
c->mask |= SD_BUS_CREDS_WELL_KNOWN_NAMES;
}