summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Olmedo Escobar <carlos.olmedo.e@gmail.com>2015-01-21 01:44:54 +0100
committerKeith Packard <keithp@keithp.com>2015-01-23 10:03:57 -0800
commitf27d743c1899f307ec8063febbb3198c8945d372 (patch)
treee76b709829118d4847831ae2d4f907f1237e3e0e
parent437d2ec5f250f8ab4b44cbae56f938719802e1cc (diff)
Avoid possible null pointer dereference.
Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xwayland/xwayland.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 37d6d8270..7e8d667d6 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -513,9 +513,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
int ret, bpc, green_bpc, i;
xwl_screen = calloc(sizeof *xwl_screen, 1);
- xwl_screen->wm_fd = -1;
if (xwl_screen == NULL)
return FALSE;
+ xwl_screen->wm_fd = -1;
if (!dixRegisterPrivateKey(&xwl_screen_private_key, PRIVATE_SCREEN, 0))
return FALSE;