summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_android.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2016-08-04 10:07:54 +0800
committerEmil Velikov <emil.l.velikov@gmail.com>2016-08-15 19:00:30 +0100
commitc0580f6a3859ec373ed11b3a6266c9b94d01a343 (patch)
treea2d8d6470bcc814b6507695ade3e01d97c7c2b32 /src/egl/drivers/dri2/platform_android.c
parenta9e8fb73977beaa407b72c4843e75db3b186ea09 (diff)
downloadexternal_mesa3d-c0580f6a3859ec373ed11b3a6266c9b94d01a343.zip
external_mesa3d-c0580f6a3859ec373ed11b3a6266c9b94d01a343.tar.gz
external_mesa3d-c0580f6a3859ec373ed11b3a6266c9b94d01a343.tar.bz2
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" <mesa-stable@lists.freedesktop.org> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_android.c')
-rw-r--r--src/egl/drivers/dri2/platform_android.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 925c1a5..e7b30b4 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);
}