[PATCH libinput v2] evdev-mt-touchpad: check calloc result
Peter Hutterer
peter.hutterer at who-t.net
Mon Apr 28 14:32:25 PDT 2014
On Wed, Apr 23, 2014 at 01:03:33PM +0200, Carlos Olmedo Escobar wrote:
> Check the value returned by calloc.
sorry for the delay, still catching up on emails. we use signed-off-by tags
in libinput. If I can have yours for this patch, I'll push it out asap,
thanks.
Cheers,
Peter
> ---
> src/evdev-mt-touchpad.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
> index 6355364..109441d 100644
> --- a/src/evdev-mt-touchpad.c
> +++ b/src/evdev-mt-touchpad.c
> @@ -721,6 +721,8 @@ tp_init_slots(struct tp_dispatch *tp,
> }
> tp->touches = calloc(tp->ntouches,
> sizeof(struct tp_touch));
> + if (!tp->touches)
> + return -1;
>
> return 0;
> }
> --
> 2.0.0.rc0
>
More information about the wayland-devel
mailing list