struct shell_data_init *sh = new struct shell_data_init;
wl_display = wl_display_connect(NULL);
+ if (!wl_display) {
+ ret = -1;
+ goto err_failed_display;
+ }
registry = wl_display_get_registry(wl_display);
sh->wait_for_bound = true;
sh->bound_fail = false;
err:
wl_registry_destroy(registry);
wl_display_disconnect(wl_display);
+
+err_failed_display:
delete sh;
return ret;
}
struct shell_data *sh = new struct shell_data;
+ if (!wl_display) {
+ goto err;
+ }
+
sh->wl_display = wl_display;
sh->wait_for_doas = true;
sh->wait_for_bound = true;