egl/dri2: don't leak the fd on dri2_terminate
[mesa.git] / src / egl / drivers / dri2 / platform_x11.c
index bf7d2bea4c1f9c8c196bb04b9a3b7bae8a24823c..7991fc2b67b4c9d66625caa654eeb70021ea9b1b 100644 (file)
@@ -1161,6 +1161,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
     * Every hardware driver_name is set using strdup. Doing the same in
     * here will allow is to simply free the memory at dri2_terminate().
     */
+   dri2_dpy->fd = -1;
    dri2_dpy->driver_name = strdup("swrast");
    if (!dri2_load_driver_swrast(disp))
       goto cleanup_conn;