[PATCH] Avoid possible null pointer dereference.

Alan Coopersmith alan.coopersmith at oracle.com
Tue Jan 20 16:49:55 PST 2015


On 01/20/15 04:44 PM, Carlos Olmedo Escobar wrote:
> 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;
>

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list