mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-09 02:28:08 +02:00
simple-shm: Handle OOM when allocating struct display
This commit is contained in:
parent
20ffdffc03
commit
96c619af43
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue