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>
This commit is contained in:
Carlos Olmedo Escobar 2015-01-21 01:44:54 +01:00 committed by Keith Packard
parent 437d2ec5f2
commit f27d743c18

View File

@ -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;