summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-02-11 11:57:34 -0700
committerAndreas Boll <andreas.boll.dev@gmail.com>2013-02-13 18:46:40 +0100
commit5fdc42fb877644ae4c3343c9391f959bc7d71515 (patch)
treeb0d34f654c3fdb9b1b5ce9b84b5e83a148a6f9dc
parent527b3b8555f695d5b349d00eb1e63208b797bf2c (diff)
dri_glx: fix use after free report
the critical error would use driverName. Found by internal RH coverity scan. Note: This is a candidate for stable branches. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit a0ec9185eb90568ab57170dc682de0ba0c9e5e62) Conflicts: 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 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);