commit | c85a9178c7b047c8fe2d3f763dd27a8a051e831f | [log] [tgz] |
---|---|---|
author | Kristian Høgsberg <krh@bitplanet.net> | Thu Aug 15 11:40:30 2013 -0700 |
committer | Kristian Høgsberg <krh@bitplanet.net> | Thu Aug 15 11:40:30 2013 -0700 |
tree | ec2b46a3cabae6671fe785ffbffb7a0797a0c44c | |
parent | 96c619af430470c36153bffe040847acd338ce53 [diff] [blame] |
simple-touch: Handle OOM when allocating struct touch
diff --git a/clients/simple-touch.c b/clients/simple-touch.c index 9e4c60a..26a9d24 100644 --- a/clients/simple-touch.c +++ b/clients/simple-touch.c
@@ -281,6 +281,10 @@ 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);