[mutter/wayland] xwayland: Fix a couple of small leaks



commit 8a3501ffe13e91a679bb9f37cb60ddf4c9021a33
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Nov 21 11:57:22 2013 +0100

    xwayland: Fix a couple of small leaks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712833

 src/wayland/meta-xwayland.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 0207c7d..cf78a59 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -102,7 +102,7 @@ bind_xserver (struct wl_client *client,
    * and unblock meta_wayland_init() to continue initializing mutter.
    * */
   g_main_loop_quit (compositor->init_loop);
-  compositor->init_loop = NULL;
+  g_clear_pointer (&compositor->init_loop, g_main_loop_unref);
 }
 
 static char *
@@ -306,6 +306,7 @@ meta_xwayland_start (MetaWaylandCompositor *compositor)
   char **env;
   char *fd_string;
   char *display_name;
+  char *log_path;
   char *args[11];
   GError *error;
 
@@ -368,6 +369,7 @@ meta_xwayland_start (MetaWaylandCompositor *compositor)
 
   display_name = g_strdup_printf (":%d",
                                   compositor->xwayland_display_index);
+  log_path = g_build_filename (g_get_user_cache_dir (), "xwayland.log", NULL);
 
   args[0] = XWAYLAND_PATH;
   args[1] = display_name;
@@ -376,7 +378,7 @@ meta_xwayland_start (MetaWaylandCompositor *compositor)
   args[4] = "-retro";
   args[5] = "-noreset";
   args[6] = "-logfile";
-  args[7] = g_build_filename (g_get_user_cache_dir (), "xwayland.log", NULL);
+  args[7] = log_path;
   args[8] = "-nolisten";
   args[9] = "all";
   args[10] = NULL;
@@ -410,6 +412,7 @@ meta_xwayland_start (MetaWaylandCompositor *compositor)
 
   g_strfreev (env);
   g_free (display_name);
+  g_free (log_path);
 
   /* We need to run a mainloop until we know xwayland has a binding
    * for our xserver interface at which point we can assume it's


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]