]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: free D-Bus error before fallback (#39131)
authorLuca Boccassi <bluca@debian.org>
Fri, 26 Sep 2025 05:00:48 +0000 (06:00 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Sep 2025 05:00:48 +0000 (14:00 +0900)
Otherwise the next call fails:

Got message type=error sender=:1.5 destination=:1.470 path=n/a
    interface=n/a member=n/a cookie=151 reply_cookie=3 signature=s
    error-name=org.freedesktop.DBus.Error.UnknownMethod
    error-message=Unknown method CreateMachineEx or interface
    org.freedesktop.machine1.Manager. Assertion
'!bus_error_is_dirty(reterr_error)' failed at
    src/libsystemd/sd-bus/sd-bus.c:2396, function sd_bus_call(). Aborting.

Follow-up for d80af3b97b94e450a002ddac13874a953f0eab3e

src/nspawn/nspawn-register.c

index 6dce6801b1e2f3528f33244226b5f85e9f0018dd..516f67c7600511cce4f99419458ce78140cfc78c 100644 (file)
@@ -294,6 +294,7 @@ int register_machine(
                 return 0;
         if (!sd_bus_error_has_name(&error, SD_BUS_ERROR_UNKNOWN_METHOD))
                 return log_error_errno(r, "Failed to register machine: %s", bus_error_message(&error, r));
+        sd_bus_error_free(&error);
         if (FLAGS_SET(flags, REGISTER_MACHINE_KEEP_UNIT)) {
                 r = bus_call_method(
                                 bus,