compositor: fix segfaults if wl_display_create fails

Added check to log the error if wl_display_create return NULL.

Fixes: #101

Signed-off-by: Silva Alejandro Ismael <silva.alejandro.ismael@gmail.com>
dev
Silva Alejandro Ismael 6 years ago
parent 2edbcbd9cd
commit 21a1f40760
  1. 5
      compositor/main.c

@ -2990,6 +2990,10 @@ int main(int argc, char *argv[])
verify_xdg_runtime_dir();
display = wl_display_create();
if (display == NULL) {
weston_log("fatal: failed to create display\n");
goto out_display;
}
loop = wl_display_get_event_loop(display);
signals[0] = wl_event_loop_add_signal(loop, SIGTERM, on_term_signal,
@ -3186,6 +3190,7 @@ out_signals:
wl_display_destroy(display);
out_display:
weston_log_file_close();
if (config)

Loading…
Cancel
Save