From 97af5c33a3032e1beb369ca5d841113c06f05493 Mon Sep 17 00:00:00 2001 From: Carlos Olmedo Escobar Date: Tue, 29 Apr 2014 01:26:28 +0200 Subject: [PATCH] touchpad: check calloc result Check the value returned by calloc. Signed-off-by: Carlos Olmedo Escobar Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- 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 63553643..109441d2 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; }