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" <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>
This commit is contained in:
Nicolas Boichat
2016-08-04 10:07:52 +08:00
committed by Emil Velikov
parent 48fd952f28
commit 0e67d86540

View File

@@ -362,6 +362,7 @@ cleanup_driver:
close(dri2_dpy->fd);
cleanup_display:
free(dri2_dpy);
disp->DriverData = NULL;
return _eglError(EGL_NOT_INITIALIZED, err);
}