ephyr: Avoid a segfault with 'DISPLAY= Xephyr -glamor'

ephyr_glamor_connect() returns NULL if we failed, but applying
xcb_connection_has_error() to NULL is not permitted.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
This commit is contained in:
Jon TURNEY 2015-02-09 13:45:44 +00:00 committed by Eric Anholt
parent 391bcf77db
commit 82634d2b69

View File

@ -443,7 +443,7 @@ hostx_init(void)
else
#endif
HostX.conn = xcb_connect(NULL, &HostX.screen);
if (xcb_connection_has_error(HostX.conn)) {
if (!HostX.conn || xcb_connection_has_error(HostX.conn)) {
fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n");
exit(1);
}