On Thu, Jun 30, 2011 at 4:17 PM, Peter Hutterer <[email protected]>wrote:

> data is allocated, needs to be freed. No real impact since xsetwacom will
> exit anyway after this.
>
> Signed-off-by: Peter Hutterer <[email protected]>
>

Reviewed-by: Ping Cheng <[email protected]>

for both patches.

Ping


> ---
>  tools/xsetwacom.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
> index 064f865..360776e 100644
> --- a/tools/xsetwacom.c
> +++ b/tools/xsetwacom.c
> @@ -1209,7 +1209,7 @@ static void special_map_property(Display *dpy,
> XDevice *dev, Atom btnact_prop, i
>
>        data = calloc(256, sizeof(long));
>        if (!parse_actions(dpy, argc, argv, data, &nitems))
> -               return;
> +               goto out;
>
>        /* obtain the button actions Atom */
>        XGetDeviceProperty(dpy, dev, btnact_prop, 0, 100, False,
> @@ -1219,14 +1219,14 @@ static void special_map_property(Display *dpy,
> XDevice *dev, Atom btnact_prop, i
>        if (offset > btnact_nitems)
>        {
>                fprintf(stderr, "Invalid offset into %s property.\n",
> XGetAtomName(dpy, btnact_prop));
> -               return;
> +               goto out;
>        }
>
>        if (format != 32 || type != XA_ATOM)
>        {
>                fprintf(stderr, "Property '%s' in an unexpected format. This
> is a bug.\n",
>                        XGetAtomName(dpy, btnact_prop));
> -               return;
> +               goto out;
>        }
>
>        /* set or unset the property */
> @@ -1265,6 +1265,8 @@ static void special_map_property(Display *dpy,
> XDevice *dev, Atom btnact_prop, i
>        }
>
>        XFlush(dpy);
> +out:
> +       free(data);
>  }
>
>  /**
> --
> 1.7.5.4
>
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Linuxwacom-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to