Module: Mesa
Branch: master
Commit: 0e67d86540cb5f6bedffe4ff5dfcb1070e76b28b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e67d86540cb5f6bedffe4ff5dfcb1070e76b28b

Author: Nicolas Boichat <[email protected]>
Date:   Thu Aug  4 10:07:52 2016 +0800

egl/surfaceless: Set disp->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" <[email protected]>
Signed-off-by: Nicolas Boichat <[email protected]>
Tested-by: Martin Peres <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>

---

 src/egl/drivers/dri2/platform_surfaceless.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/egl/drivers/dri2/platform_surfaceless.c 
b/src/egl/drivers/dri2/platform_surfaceless.c
index 8ce6162..e0d383b 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -362,6 +362,7 @@ cleanup_driver:
    close(dri2_dpy->fd);
 cleanup_display:
    free(dri2_dpy);
+   disp->DriverData = NULL;
 
    return _eglError(EGL_NOT_INITIALIZED, err);
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to