[PATCH synaptics 1/2] Plug memory leak for option_string

Dave Airlie airlied at gmail.com
Thu May 9 17:33:15 PDT 2013


On Thu, May 9, 2013 at 11:14 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> xf86SetStrOption() returns a strdup'd string that must be freed after use.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Reviewed-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/synaptics.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/synaptics.c b/src/synaptics.c
> index 2de05d4..d4b21a9 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -513,12 +513,15 @@ set_softbutton_areas_option(InputInfoPtr pInfo)
>      memcpy(pars->softbutton_areas[0], values, 4 * sizeof(int));
>      memcpy(pars->softbutton_areas[1], values + 4, 4 * sizeof(int));
>
> +    free(option_string);
> +
>      return;
>
>   fail:
>      xf86IDrvMsg(pInfo, X_ERROR,
>                  "invalid SoftButtonAreas value '%s', keeping defaults\n",
>                  option_string);
> +    free(option_string);
>  }
>
>  static void
> --
> 1.8.1.4
>
> _______________________________________________
> 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