mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 13:38:05 +02:00
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>
(cherry picked from commit 21a1f40760)
This commit is contained in:
parent
9618f65c3d
commit
066f669d8d
1 changed files with 5 additions and 0 deletions
|
|
@ -2974,6 +2974,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,
|
||||
|
|
@ -3169,6 +3173,7 @@ out_signals:
|
|||
|
||||
wl_display_destroy(display);
|
||||
|
||||
out_display:
|
||||
weston_log_file_close();
|
||||
|
||||
if (config)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue