]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind-session-dbus: drop unneeded unref_and_replace
authorMike Yuan <me@yhndnzj.com>
Tue, 20 Feb 2024 10:03:14 +0000 (18:03 +0800)
committerMike Yuan <me@yhndnzj.com>
Wed, 21 Feb 2024 07:37:33 +0000 (15:37 +0800)
If there's pending s->upgrade_message, we already return early
above.

src/login/logind-session-dbus.c

index ae71e2fc7b6b5613c1dcf770d20ca81bf2fbb97d..0411d85c336a795404e658c0312a1169e2f5bc57 100644 (file)
@@ -451,7 +451,7 @@ static int method_set_class(sd_bus_message *message, void *userdata, sd_bus_erro
 
         session_set_class(s, class);
 
-        unref_and_replace_full(s->upgrade_message, message, sd_bus_message_ref, sd_bus_message_unref);
+        s->upgrade_message = sd_bus_message_ref(message);
 
         r = session_send_upgrade_reply(s, /* error= */ NULL);
         if (r < 0)