diff options
-rw-r--r-- | src/glx/dri_glx.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 9bfcb0c082..510e94b7fa 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -865,7 +865,6 @@ driCreateScreen(int screen, struct glx_display *priv) } psc->driver = driOpenDriver(driverName); - Xfree(driverName); if (psc->driver == NULL) goto cleanup; @@ -913,11 +912,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); |