chiark / gitweb /
exec: support unlimited resources
[elogind.git] / src / dbus-unit.c
index 52e8599e7c52d180efdd3b5b28f31b75b345d77c..b5daa66b5d4b7032db623bfdddb185381eed6f97 100644 (file)
@@ -455,8 +455,6 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusConnection *conn
                         goto oom;
         }
 
-        free(path);
-
         if (reply) {
                 if (!dbus_connection_send(connection, reply, NULL))
                         goto oom;
@@ -464,6 +462,8 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusConnection *conn
                 dbus_message_unref(reply);
         }
 
+        free(path);
+
         return DBUS_HANDLER_RESULT_HANDLED;
 
 oom:
@@ -568,6 +568,8 @@ static DBusHandlerResult bus_unit_message_handler(DBusConnection *connection, DB
 
                 if (r == -ENOENT) {
                         DBusError e;
+
+                        dbus_error_init(&e);
                         dbus_set_error_const(&e, DBUS_ERROR_UNKNOWN_OBJECT, "Unknown unit");
                         return bus_send_error_reply(m, connection, message, &e, r);
                 }