diff options
author | Monsta <[email protected]> | 2015-09-04 11:05:47 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2015-09-25 16:24:53 +0300 |
commit | a21ad8d8ab4e2767477c11adbfca1e03600d0fd0 (patch) | |
tree | db0af8c69720038467d6e360a689e039804a3eeb /plugins/mouse | |
parent | ac049a8d3702d29dc27acfb7ff6ea8e296cda117 (diff) | |
download | mate-settings-daemon-a21ad8d8ab4e2767477c11adbfca1e03600d0fd0.tar.bz2 mate-settings-daemon-a21ad8d8ab4e2767477c11adbfca1e03600d0fd0.tar.xz |
mouse: fix memleak
adapted from
https://git.gnome.org/browse/gnome-settings-daemon/commit?id=5ee48ce8aa66f6c4fdc4aa2c07bc03bdb83bcb65
Diffstat (limited to 'plugins/mouse')
-rw-r--r-- | plugins/mouse/msd-mouse-manager.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/mouse/msd-mouse-manager.c b/plugins/mouse/msd-mouse-manager.c index 459ef0f..f61c547 100644 --- a/plugins/mouse/msd-mouse-manager.c +++ b/plugins/mouse/msd-mouse-manager.c @@ -570,6 +570,18 @@ set_middle_button (MsdMouseManager *manager, XFreeDeviceList (device_info); } +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 int set_disable_w_typing (MsdMouseManager *manager, gboolean state) { @@ -588,7 +600,7 @@ set_disable_w_typing (MsdMouseManager *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; g_spawn_async (g_get_home_dir (), args, NULL, |