From e14017563ead7883c9469cc5f12327ebfc8b38e0 Mon Sep 17 00:00:00 2001 From: KT-lcz <54447789+KT-lcz@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:45:46 +0800 Subject: [PATCH] fix: need goto out after g_set_error goto out needs to be executed after g_set_error , otherwise the assertion will be triggered in g_assert (process != NULL); --- src/polkitbackend/polkitbackendsessionmonitor-systemd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c index 91832b1a..05f5243f 100644 --- a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c +++ b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c @@ -374,6 +374,7 @@ polkit_backend_session_monitor_get_session_for_subject (PolkitBackendSessionMoni POLKIT_ERROR_NOT_SUPPORTED, "Cannot get session for subject of type %s", g_type_name (G_TYPE_FROM_INSTANCE (subject))); + goto out; } #if HAVE_SD_PIDFD_GET_SESSION