summaryrefslogtreecommitdiff
path: root/clients/simple-touch.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-08-15 11:40:30 -0700
committerKristian Høgsberg <krh@bitplanet.net>2013-08-15 11:40:30 -0700
commitc85a9178c7b047c8fe2d3f763dd27a8a051e831f (patch)
treeec2b46a3cabae6671fe785ffbffb7a0797a0c44c /clients/simple-touch.c
parent96c619af430470c36153bffe040847acd338ce53 (diff)
simple-touch: Handle OOM when allocating struct touch
Diffstat (limited to 'clients/simple-touch.c')
-rw-r--r--clients/simple-touch.c4
1 files changed, 4 insertions, 0 deletions
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);