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>
This commit is contained in:
parent
0a78b599b3
commit
f42520c5f1
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue