From 96c619af430470c36153bffe040847acd338ce53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 15 Aug 2013 11:39:52 -0700 Subject: [PATCH] simple-shm: Handle OOM when allocating struct display --- clients/simple-shm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/simple-shm.c b/clients/simple-shm.c index 98102ebfc..1bcf8b082 100644 --- a/clients/simple-shm.c +++ b/clients/simple-shm.c @@ -335,6 +335,10 @@ create_display(void) struct display *display; display = malloc(sizeof *display); + if (display == NULL) { + fprintf(stderr, "out of memory\n"); + exit(1); + } display->display = wl_display_connect(NULL); assert(display->display);