ephyr: Avoid a segfault with 'DISPLAY= Xephy -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>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
(cherry picked from commit f42520c5f1)
This commit is contained in:
Jon TURNEY 2015-02-04 17:04:45 +00:00 committed by Adam Jackson
parent dee92c7805
commit 74ab42c85b
1 changed files with 1 additions and 1 deletions

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);
}