[mutter/wip/carlosg/coverity-fixes: 8/13] x11: Drop fallback on ~/.mutter paths
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/coverity-fixes: 8/13] x11: Drop fallback on ~/.mutter paths
- Date: Mon, 25 Oct 2021 09:17:23 +0000 (UTC)
commit 2e60804e87a96554eabb4d838749b5ea9e860367
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Oct 24 23:11:57 2021 +0200
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
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 339a7ae335..95f4f68e73 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]