On Thu, Jun 21, 2012 at 11:31 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> move out: statement up to make sure we free values on error as well.
>
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> ---
>  tools/xsetwacom.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
> index 28332d1..923cf64 100644
> --- a/tools/xsetwacom.c
> +++ b/tools/xsetwacom.c
> @@ -1647,10 +1647,10 @@ static void set(Display *dpy, int argc, char **argv)
>                                PropModeReplace, data, nitems);
>        XFlush(dpy);
>
> +out:
>        for (i = 0; i < nvals; i++)
>                free(values[i]);
>        free(values);
> -out:
>        XCloseDevice(dpy, dev);
>        free(data);
>  }
> --
> 1.7.10.2
>
>
Good catch, but you'll want to keep around a label at the original
location as well for the 6 goto statements which precede the
initialization of 'values'. Otherwise even misspelling a parameter
name will send xsetwacom up in flames :)

Jason

---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to