Check the value returned by calloc.
---
 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

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to