simple-shm: Handle OOM when allocating struct display
diff --git a/clients/simple-shm.c b/clients/simple-shm.c
index 98102eb..1bcf8b0 100644
--- a/clients/simple-shm.c
+++ b/clients/simple-shm.c
@@ -335,6 +335,10 @@
 	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);