From: Nicolas Boichat Date: Thu, 4 Aug 2016 02:07:54 +0000 (+0800) Subject: egl/android: Set dpy->DriverData to NULL on error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0580f6a3859ec373ed11b3a6266c9b94d01a343;p=mesa.git egl/android: Set dpy->DriverData to NULL on error Avoid use-after-free on error. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Signed-off-by: Nicolas Boichat Tested-by: Martin Peres Reviewed-by: Emil Velikov --- diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 925c1a5b538..e7b30b4eeb5 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -984,6 +984,7 @@ cleanup_device: close(dri2_dpy->fd); cleanup_display: free(dri2_dpy); + dpy->DriverData = NULL; return _eglError(EGL_NOT_INITIALIZED, err); }