mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
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 a0ec9185eb)
Conflicts:
src/glx/dri_glx.c
This commit is contained in:
parent
527b3b8555
commit
5fdc42fb87
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue