diff options
author | Ray Strode <rstrode@redhat.com> | 2021-07-28 12:13:57 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2021-07-28 12:27:45 -0400 |
commit | b1367915672ea51c99b21ac764a8452d0529a5ea (patch) | |
tree | a73b88798eb94ace5ee21b2610ded6bd498d1e6d | |
parent | 4a7ef1e94fbfaf4ed2506183b3ef35f2ff458a62 (diff) | |
download | gdm-b1367915672ea51c99b21ac764a8452d0529a5ea.tar.gz |
session: Fix gdm_session_is_wayland_session
gdm_session_is_wayland_session has two problems:
1. it's leaking the full patch returned
2. It's not honoring the supported-session-types
preference ordered list when determining which session to pick.
This commit fixes both issues.
-rw-r--r-- | daemon/gdm-session.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c index e3e6410d..11762bfb 100644 --- a/daemon/gdm-session.c +++ b/daemon/gdm-session.c @@ -3204,21 +3204,19 @@ gdm_session_is_wayland_session (GdmSession *self) { GKeyFile *key_file; gboolean is_wayland_session = FALSE; - char *filename; - char *full_path = NULL; + char *filename; + g_autofree char *full_path = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (GDM_IS_SESSION (self), FALSE); filename = get_session_filename (self); - if (supports_session_type (self, "wayland")) { - key_file = load_key_file_for_file (self, filename, "wayland", &full_path); + key_file = load_key_file_for_file (self, filename, NULL, &full_path); - if (key_file == NULL) { - goto out; - } - } + if (key_file == NULL) { + goto out; + } if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) { is_wayland_session = TRUE; |