diff options
author | Brian Paul <brianp@vmware.com> | 2013-02-11 11:57:34 -0700 |
---|---|---|
committer | Andreas Boll <andreas.boll.dev@gmail.com> | 2013-02-13 18:46:40 +0100 |
commit | 5fdc42fb877644ae4c3343c9391f959bc7d71515 (patch) | |
tree | b0d34f654c3fdb9b1b5ce9b84b5e83a148a6f9dc | |
parent | 527b3b8555f695d5b349d00eb1e63208b797bf2c (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.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); |