return 0;
}
- r = set_ensure_allocated(&m->private_buses, NULL);
- if (r < 0) {
- log_oom();
- return 0;
- }
-
r = sd_bus_new(&bus);
if (r < 0) {
log_warning_errno(r, "Failed to allocate new private connection bus: %m");
return 0;
}
- r = set_put(m->private_buses, bus);
+ r = set_ensure_put(&m->private_buses, NULL, bus);
+ if (r == -ENOMEM) {
+ log_oom();
+ return 0;
+ }
if (r < 0) {
log_warning_errno(r, "Failed to add new connection bus to set: %m");
return 0;
}
- bus = NULL;
+ TAKE_PTR(bus);
log_debug("Accepted new private connection.");