[gnome-settings-daemon] mouse: Plug a mem leak
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] mouse: Plug a mem leak
- Date: Thu, 3 Nov 2011 13:28:30 +0000 (UTC)
commit 04679f89ef410d6b5d05ad36228e9b2d171e79b8
Author: Christian Persch <chpe gnome org>
Date: Thu Nov 3 14:11:46 2011 +0100
mouse: Plug a mem leak
==22370== 708 bytes in 12 blocks are definitely lost in loss record 11,519 of 11,921
==22370== at 0x402AD89: malloc (vg_replace_malloc.c:236)
==22370== by 0x4E68023: XGetFeedbackControl (XGetFCtl.c:132)
==22370== by 0x7F5D1EA: set_motion (gsd-mouse-manager.c:451)
==22370== by 0x7F5EC5C: set_mouse_settings (gsd-mouse-manager.c:894)
==22370== by 0x7F5EF86: gsd_mouse_manager_idle_cb (gsd-mouse-manager.c:1097)
Bug #663239.
plugins/mouse/gsd-mouse-manager.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index 922d44c..a1a9903 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -450,7 +450,7 @@ set_motion (GsdMouseManager *manager,
/* Get the list of feedbacks for the device */
states = XGetFeedbackControl (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice, &num_feedbacks);
if (states == NULL)
- num_feedbacks = 0;
+ goto out;
state = (XFeedbackState *) states;
for (i = 0; i < num_feedbacks; i++) {
if (state->class == PtrFeedbackClass) {
@@ -475,6 +475,10 @@ set_motion (GsdMouseManager *manager,
state = (XFeedbackState *) ((char *) state + state->length);
}
+ XFreeFeedbackList (states);
+
+ out:
+
XCloseDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]