[PATCH] Avoid possible null pointer dereference.

Carlos Olmedo Escobar carlos.olmedo.e at gmail.com
Tue Jan 20 16:44:54 PST 2015


Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e at gmail.com>
---
 hw/xwayland/xwayland.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 37d6d82..7e8d667 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;
-- 
2.1.4



More information about the xorg-devel mailing list