diff --git a/clients/simple-touch.c b/clients/simple-touch.c index 9e4c60ab..26a9d240 100644 --- a/clients/simple-touch.c +++ b/clients/simple-touch.c @@ -281,6 +281,10 @@ touch_create(int width, int height) struct touch *touch; touch = malloc(sizeof *touch); + if (touch == NULL) { + fprintf(stderr, "out of memory\n"); + exit(1); + } touch->display = wl_display_connect(NULL); assert(touch->display);