egl/android: Set dpy->DriverData to NULL on error
authorNicolas Boichat <drinkcat@chromium.org>
Thu, 4 Aug 2016 02:07:54 +0000 (10:07 +0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 15 Aug 2016 18:00:30 +0000 (19:00 +0100)
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>
src/egl/drivers/dri2/platform_android.c

index 925c1a5b5384bc0e24cc6047d5d186c998e4c939..e7b30b4eeb50024d234559167a4c2f3c4138d0c8 100644 (file)
@@ -984,6 +984,7 @@ cleanup_device:
    close(dri2_dpy->fd);
 cleanup_display:
    free(dri2_dpy);
+   dpy->DriverData = NULL;
 
    return _eglError(EGL_NOT_INITIALIZED, err);
 }