window: Free the allocated display if we fail to setup libxkbcommon

This commit is contained in:
Rob Bradford 2013-07-26 16:29:43 +01:00 committed by Kristian Høgsberg
parent 6b2e3f3722
commit 35483aaab9

View file

@ -4976,6 +4976,13 @@ display_create(int *argc, char *argv[])
return NULL;
}
d->xkb_context = xkb_context_new(0);
if (d->xkb_context == NULL) {
fprintf(stderr, "Failed to create XKB context\n");
free(d);
return NULL;
}
d->epoll_fd = os_epoll_create_cloexec();
d->display_fd = wl_display_get_fd(d->display);
d->display_task.run = handle_display_data;
@ -4987,12 +4994,6 @@ display_create(int *argc, char *argv[])
wl_list_init(&d->output_list);
wl_list_init(&d->global_list);
d->xkb_context = xkb_context_new(0);
if (d->xkb_context == NULL) {
fprintf(stderr, "Failed to create XKB context\n");
return NULL;
}
d->workspace = 0;
d->workspace_count = 1;