diff -ru mesa-20080905.orig/src/glx/x11/dri_common.c mesa-20080905/src/glx/x11/dri_common.c --- mesa-20080905.orig/src/glx/x11/dri_common.c 2008-09-18 17:53:24.000000000 +0100 +++ mesa-20080905/src/glx/x11/dri_common.c 2008-09-19 11:32:24.000000000 +0100 @@ -329,6 +329,16 @@ } _X_HIDDEN void +driReleaseConfigs(__DRIconfig **driConfigs) +{ + int i; + for (i = 0; driConfigs[i]; i++) { + Xfree(driConfigs[i]); + } + Xfree(driConfigs); +} + +_X_HIDDEN void driBindExtensions(__GLXscreenConfigs *psc, int dri2) { const __DRIextension **extensions; diff -ru mesa-20080905.orig/src/glx/x11/dri_common.h mesa-20080905/src/glx/x11/dri_common.h --- mesa-20080905.orig/src/glx/x11/dri_common.h 2008-09-18 17:53:24.000000000 +0100 +++ mesa-20080905/src/glx/x11/dri_common.h 2008-09-19 10:20:52.000000000 +0100 @@ -47,6 +47,8 @@ driConvertConfigs(const __DRIcoreExtension *core, __GLcontextModes *modes, const __DRIconfig **configs); +extern void driReleaseConfigs(__DRIconfig **a); + extern const __DRIsystemTimeExtension systemTimeExtension; extern void InfoMessageF(const char *f, ...); diff -ru mesa-20080905.orig/src/glx/x11/drisw_glx.c mesa-20080905/src/glx/x11/drisw_glx.c --- mesa-20080905.orig/src/glx/x11/drisw_glx.c 2008-09-18 17:53:24.000000000 +0100 +++ mesa-20080905/src/glx/x11/drisw_glx.c 2008-09-19 10:58:55.000000000 +0100 @@ -340,6 +340,7 @@ /* Free the direct rendering per screen data */ (*psc->core->destroyScreen)(psc->__driScreen); psc->__driScreen = NULL; + driReleaseConfigs(psc->driver_configs); if (psc->driver) dlclose(psc->driver); } @@ -348,7 +349,6 @@ __GLXdisplayPrivate *priv) { __GLXDRIscreen *psp; - const __DRIconfig **driver_configs; const __DRIextension **extensions; const char *driverName = "swrast"; int i; @@ -384,7 +384,7 @@ psc->__driScreen = psc->swrast->createNewScreen(screen, - loader_extensions, &driver_configs, psc); + loader_extensions, &psc->driver_configs, psc); if (psc->__driScreen == NULL) { ErrorMessageF("failed to create dri screen\n"); goto handle_error; @@ -392,8 +392,8 @@ driBindExtensions(psc, 0); - psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); - psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + psc->configs = driConvertConfigs(psc->core, psc->configs, psc->driver_configs); + psc->visuals = driConvertConfigs(psc->core, psc->visuals, psc->driver_configs); psp->destroyScreen = driDestroyScreen; psp->createContext = driCreateContext; diff -ru mesa-20080905.orig/src/glx/x11/glxclient.h mesa-20080905/src/glx/x11/glxclient.h --- mesa-20080905.orig/src/glx/x11/glxclient.h 2008-09-18 17:53:24.000000000 +0100 +++ mesa-20080905/src/glx/x11/glxclient.h 2008-09-19 11:19:15.000000000 +0100 @@ -468,6 +468,7 @@ * Per screen direct rendering interface functions and data. */ __DRIscreen *__driScreen; + __DRIconfig **driver_configs; const __DRIcoreExtension *core; const __DRIlegacyExtension *legacy; const __DRIswrastExtension *swrast;