simple-shm: Handle OOM when allocating struct display

This commit is contained in:
Kristian Høgsberg 2013-08-15 11:39:52 -07:00
parent 20ffdffc03
commit 96c619af43
1 changed files with 4 additions and 0 deletions

View File

@ -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);