summaryrefslogtreecommitdiffstats
path: root/src/glx/dri_glx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/dri_glx.c')
-rw-r--r--src/glx/dri_glx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index de777fbba8b..f42db79ad61 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -805,7 +805,6 @@ driCreateScreen(int screen, struct glx_display *priv)
}
psc->driver = driOpenDriver(driverName);
- free(driverName);
if (psc->driver == NULL)
goto cleanup;
@@ -847,11 +846,15 @@ driCreateScreen(int screen, struct glx_display *priv)
psp->setSwapInterval = driSetSwapInterval;
psp->getSwapInterval = driGetSwapInterval;
+ free(driverName);
+
return &psc->base;
cleanup:
CriticalErrorMessageF("failed to load driver: %s\n", driverName);
+ free(driverName);
+
if (psc->driver)
dlclose(psc->driver);
glx_screen_cleanup(&psc->base);