From 025dbbbc94fd49e7faed6969a4c8d290fa89de76 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 24 Oct 2021 23:11:57 +0200 Subject: [PATCH] x11: Drop fallback on ~/.mutter paths This old handling of session files looked on ~/.mutter, which has been unused and unsupported for a long time. It also had paths were the GError was leaked. Fix both by dropping the legacy code, and falling back to the common error paths. CID: #1502682 Part-of: --- src/x11/session.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/x11/session.c b/src/x11/session.c index 339a7ae33..95f4f68e7 100644 --- a/src/x11/session.c +++ b/src/x11/session.c @@ -1114,30 +1114,8 @@ load_state (const char *previous_save_file) &length, &error)) { - char *canonical_session_file = session_file; - - /* Maybe they were doing it the old way, with ~/.mutter */ - session_file = g_strconcat (g_get_home_dir (), - G_DIR_SEPARATOR_S ".mutter" - G_DIR_SEPARATOR_S "sessions" - G_DIR_SEPARATOR_S, - previous_save_file, - NULL); - - if (!g_file_get_contents (session_file, - &text, - &length, - NULL)) - { - /* oh, just give up */ - - g_error_free (error); - g_free (session_file); - g_free (canonical_session_file); - return NULL; - } - - g_free (canonical_session_file); + g_free (session_file); + goto error; } meta_topic (META_DEBUG_SM, "Parsing saved session file %s", session_file);