summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2015-05-26 11:53:26 +0200
committerBastien Nocera <hadess@hadess.net>2015-05-26 12:03:57 +0200
commit5d66158a656513a753dc8f5bd6015c222001da36 (patch)
tree2941c9fcdc8ab637d8e0375e085ad7f97eadc482
parent8ec4957be774d92b8bdeb1b618738844873cf354 (diff)
downloadgnome-settings-daemon-5d66158a656513a753dc8f5bd6015c222001da36.tar.gz
wacom: Fix possible double-free in LED helper
From coverity: gnome-settings-daemon-3.14.4/plugins/wacom/gsd-wacom-led-helper.c:130: double_free: Calling "g_free" frees pointer "status" which has already been freed. https://bugzilla.gnome.org/show_bug.cgi?id=749882
-rw-r--r--plugins/wacom/gsd-wacom-led-helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/wacom/gsd-wacom-led-helper.c b/plugins/wacom/gsd-wacom-led-helper.c
index 2f558ee2..5aed3479 100644
--- a/plugins/wacom/gsd-wacom-led-helper.c
+++ b/plugins/wacom/gsd-wacom-led-helper.c
@@ -103,6 +103,7 @@ get_led_sys_path (GUdevClient *client,
goto no_parent;
status = g_strdup_printf ("status_led%d_select", group_num);
filename = g_build_filename (g_udev_device_get_sysfs_path (parent), "wacom_led", status, NULL);
+ g_free (status);
*write_value = led_num;
} else {
@@ -119,6 +120,7 @@ get_led_sys_path (GUdevClient *client,
if (g_strrstr (dev_uniq, dev_hid_uniq)){
status = g_strdup_printf ("/leds/%s:selector:%i/brightness", g_udev_device_get_name (hid_dev), led_num);
filename = g_build_filename (g_udev_device_get_sysfs_path (hid_dev), status, NULL);
+ g_free (status);
break;
}
element = g_list_next(element);
@@ -127,7 +129,6 @@ get_led_sys_path (GUdevClient *client,
*write_value = LED_BRIGHTNESS;
}
- g_free (status);
g_object_unref (parent);