diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 1 | ||||
-rw-r--r-- | src/machine/machined-dbus.c | 18 |
2 files changed, 6 insertions, 13 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 18c2d1c19d..bc67c32380 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -639,7 +639,6 @@ int sd_bus_message_new_method_errorf( const char *format, ...) { - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus_message *t; va_list ap; int r; diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c index 22caadfceb..2b622d1793 100644 --- a/src/machine/machined-dbus.c +++ b/src/machine/machined-dbus.c @@ -203,7 +203,7 @@ static int bus_manager_create_machine(Manager *manager, DBusMessage *message) { r = manager_add_machine(manager, name, &m); if (r < 0) - goto fail; + return r; m->leader = leader; m->class = c; @@ -234,8 +234,7 @@ static int bus_manager_create_machine(Manager *manager, DBusMessage *message) { return 0; fail: - if (m) - machine_add_to_gc_queue(m); + machine_add_to_gc_queue(m); return r; } @@ -1003,17 +1002,12 @@ int manager_add_machine(Manager *m, const char *name, Machine **_machine) { assert(name); machine = hashmap_get(m->machines, name); - if (machine) { - if (_machine) - *_machine = machine; - - return 0; + if (!machine) { + machine = machine_new(m, name); + if (!machine) + return -ENOMEM; } - machine = machine_new(m, name); - if (!machine) - return -ENOMEM; - if (_machine) *_machine = machine; |