diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-06-01 19:47:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-06-01 19:47:46 +0200 |
commit | c87eba546a33ce7ecd66f0e3b61bdf55ae1389f0 (patch) | |
tree | 8309a2b911264e57f95dcb860983e5f8ea506c40 /src/dbus-unit.c | |
parent | f306f4c40d7004be058678ff3ed90c9c006767e0 (diff) |
dbus: add simplified way to start an arbitrary unit in a single method call
Diffstat (limited to 'src/dbus-unit.c')
-rw-r--r-- | src/dbus-unit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dbus-unit.c b/src/dbus-unit.c index 87218cd2ee..8e35377dc5 100644 --- a/src/dbus-unit.c +++ b/src/dbus-unit.c @@ -260,6 +260,7 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusMessage *message Manager *m = u->meta.manager; DBusError error; JobType job_type = _JOB_TYPE_INVALID; + char *path = NULL; dbus_error_init(&error); @@ -281,7 +282,6 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusMessage *message JobMode mode; Job *j; int r; - char *path; if (job_type == JOB_START && u->meta.only_by_dependency) return bus_send_error_reply(m, message, NULL, -EPERM); @@ -312,6 +312,8 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusMessage *message goto oom; } + free(path); + if (reply) { if (!dbus_connection_send(m->api_bus, reply, NULL)) goto oom; @@ -322,6 +324,8 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusMessage *message return DBUS_HANDLER_RESULT_HANDLED; oom: + free(path); + if (reply) dbus_message_unref(reply); |