diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-06-25 14:24:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-07-04 21:16:16 +1000 |
commit | a9c09f8f8e2a97e4bfe927bc4c7f29b04ee3403a (patch) | |
tree | e57a5303dd909fafc3219da68eae61cddf1e1dcc /dix | |
parent | 55ff20eb37f00a3ad07b5acff19d4497ab513a97 (diff) |
dix: fix memory leak in TouchEventHistoryReplay
Don't leak if ti->history is NULL.
Found by coverity.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/touch.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dix/touch.c b/dix/touch.c index 06b15ef4b..497ad7dac 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -463,14 +463,17 @@ TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev) void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource) { - InternalEvent *tel = InitEventList(GetMaximumEventsNum()); - ValuatorMask *mask = valuator_mask_new(0); + InternalEvent *tel; + ValuatorMask *mask; int i, nev; int flags; if (!ti->history) return; + tel = InitEventList(GetMaximumEventsNum()); + mask = valuator_mask_new(0); + valuator_mask_set_double(mask, 0, ti->history[0].valuators.data[0]); valuator_mask_set_double(mask, 1, ti->history[0].valuators.data[1]); |