[PATCH] xkb: check for NULL pointer before dereferences it in XkbAddClientResource

Peter Hutterer peter.hutterer at who-t.net
Mon Apr 19 17:29:35 PDT 2010


On Mon, Apr 19, 2010 at 08:58:07PM +0300, Tiago Vignatti wrote:
> ---
>  xkb/xkbEvents.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
> index 33741e9..9755f98 100644
> --- a/xkb/xkbEvents.c
> +++ b/xkb/xkbEvents.c
> @@ -1041,8 +1041,7 @@ XkbInterestPtr	interest;
>  	    return ((interest->resource==id)?interest:NULL);
>  	interest = interest->next;
>      }
> -    interest = xalloc(sizeof(XkbInterestRec));
> -    bzero(interest,sizeof(XkbInterestRec));
> +    interest = xcalloc(1, sizeof(XkbInterestRec));
>      if (interest) {
>  	interest->dev = dev;
>  	interest->client = client;
> -- 
> 1.6.0.4

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>



More information about the xorg-devel mailing list