From: Tomasz Figa Date: Wed, 5 Jul 2017 14:56:51 +0000 (+0900) Subject: egl: android: Fix potential use of unitialized variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ede0f9dff519fe4444da91031c687207b0d9c5f;p=mesa.git egl: android: Fix potential use of unitialized variable If dri2_setup_extensions() fails, the "err" variable would not be assigned causing the error path to access an unitialized variable. Fix it by assigning an error message. Fixes: 2c341f2bda4 ("egl: refactor dri2_create_screen() into three separate functions") Signed-off-by: Tomasz Figa Reviewed-by: Eric Engestrom Reviewed-by: Emil Velikov --- diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 3be69d87ffa..13006fee873 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -1214,8 +1214,10 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy) goto cleanup; } - if (!dri2_setup_extensions(dpy)) + if (!dri2_setup_extensions(dpy)) { + err = "DRI2: failed to setup extensions"; goto cleanup; + } dri2_setup_screen(dpy);