simple-touch: Handle OOM when allocating struct touch
This commit is contained in:
@@ -281,6 +281,10 @@ touch_create(int width, int height)
|
|||||||
struct touch *touch;
|
struct touch *touch;
|
||||||
|
|
||||||
touch = malloc(sizeof *touch);
|
touch = malloc(sizeof *touch);
|
||||||
|
if (touch == NULL) {
|
||||||
|
fprintf(stderr, "out of memory\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
touch->display = wl_display_connect(NULL);
|
touch->display = wl_display_connect(NULL);
|
||||||
assert(touch->display);
|
assert(touch->display);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user