wsi/x11: Fix possible null pointer dereference

Fix defect CID-1476002 reported by Coverity Scan.

wsi_x11_get_connection() could return NULL in case of memory allocation
failure. Added 'if' to catch this case, as it is done in all other
usages of this function.

Fixes: mesa/mesa@dde2e324

Signed-off-by: Yevhenii Kharchenko <yevhenii.kharchenko@globallogic.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
38 jobs for !10209 with fix/coverity-1476002 in 8 seconds (queued for 2 seconds)
latest detached
Status Job ID Name Coverage
  Sanity
passed #8819790
sanity

00:00:08

 
  Container
manual #8819795
aarch64 manual
arm_build
manual #8819797
windows shell 1809 mesa manual
windows_build_vs2019
manual #8819792
manual
x86_build-base
manual #8819794
manual
x86_test-base
 
  Container 2
created #8819812
android_build
created #8819807
i386_build
created #8819800
kernel+rootfs_amd64
created #8819801
aarch64
kernel+rootfs_arm64
created #8819818
aarch64
kernel+rootfs_arm64-baremetal
created #8819803
aarch64
kernel+rootfs_armhf
created #8819820
aarch64
kernel+rootfs_armhf-baremetal
created #8819809
ppc64el_build
created #8819811
s390x_build
created #8819805
x86_build
created #8819814
x86_test-gl
created #8819816
x86_test-vk
 
  Meson X86 64
created #8819830
meson-clang
created #8819832
meson-clover
created #8819825
meson-clover-testing
created #8819827
meson-gallium
created #8819828
meson-release
created #8819822
meson-testing
created #8819823
meson-testing-asan
created #8819834
meson-vulkan
 
  Build Misc
created #8819835
arm_test
created #8819837
meson-android
created #8819841
aarch64
meson-arm64
created #8819843
aarch64
meson-arm64-asan
created #8819845
aarch64
meson-arm64-build-test
created #8819839
aarch64
meson-armhf
created #8819849
meson-i386
created #8819855
meson-mingw32-x86_64
created #8819853
kvm
meson-ppc64el
created #8819851
kvm
meson-s390x
created #8819847
docker windows 1809 mesa
meson-windows-vs2019
 
  Amd
created #8819857
radv-fossils
 
  Layered Backends
created #8819859
docker windows 1809 mesa
test-d3d12-windows