summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorMagnus Vigerlöf <Magnus.Vigerlof@home.se>2007-04-10 23:43:58 +0300
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2007-04-10 23:58:20 +0300
commit07c56abf84080c020a3e7b7703a447c7f996975c (patch)
treef244bbd76ede388244e9823d9a7ce40045b917f3 /dix
parente92743bc9839c36914a44f3e5bc8cd85773ac794 (diff)
Input: Plug memory leak in device free
Remember to also free the motion history, if we're using the DIX-managed history.
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 9631c8678..004cb13fc 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -431,8 +431,13 @@ CloseDevice(DeviceIntPtr dev)
xfree(dev->key);
}
- if (dev->valuator)
+ if (dev->valuator) {
+ /* Counterpart to 'biggest hack ever' in init. */
+ if (dev->valuator->motion &&
+ dev->valuator->GetMotionProc == GetMotionHistory)
+ xfree(dev->valuator->motion);
xfree(dev->valuator);
+ }
if (dev->button) {
#ifdef XKB