[PATCH 3/4] dix: fix memory leak in TouchEventHistoryReplay

Dave Airlie airlied at gmail.com
Tue Jun 26 02:59:18 PDT 2012


On Tue, Jun 26, 2012 at 1:00 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> Don't leak if ti->history is NULL.
>
> Found by coverity.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Reviewed-by: Dave Airlie <airlied at redhat.com>
> ---
>  dix/touch.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/dix/touch.c b/dix/touch.c
> index 8799502..fcf7dd5 100644
> --- a/dix/touch.c
> +++ b/dix/touch.c
> @@ -462,14 +462,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]);
>
> --
> 1.7.10.2
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list