[gnome-settings-daemon] mouse: fix mem leak



commit 5ee48ce8aa66f6c4fdc4aa2c07bc03bdb83bcb65
Author: Pavel Vasin <rat4vier gmail com>
Date:   Tue Apr 24 10:31:13 2012 +0400

    mouse: fix mem leak
    
    based on patch from https://bugs.launchpad.net/launchpad-integration/+bug/483610
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674703

 plugins/mouse/gsd-mouse-manager.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index 4e2b440..8a1d444 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -515,6 +515,18 @@ setup_syndaemon (gpointer user_data)
 #endif
 }
 
+static gboolean
+have_program_in_path (const char *name)
+{
+        gchar *path;
+        gboolean result;
+
+        path = g_find_program_in_path (name);
+        result = (path != NULL);
+        g_free (path);
+        return result;
+}
+
 static void
 syndaemon_died (GPid pid, gint status, gpointer user_data)
 {
@@ -542,7 +554,7 @@ set_disable_w_typing (GsdMouseManager *manager, gboolean state)
                 args[4] = "-R";
                 args[5] = NULL;
 
-                if (!g_find_program_in_path (args[0]))
+                if (!have_program_in_path (args[0]))
                         return 0;
 
                 /* we must use G_SPAWN_DO_NOT_REAP_CHILD to avoid



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