[mutter/wip/carlosg/coverity-fixes: 3/8] x11: Drop fallback on ~/.mutter paths




commit ba2d7cd24dc983f1e7b15d23f923a0c78e20c6af
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]