summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorHenri Verbeet <[email protected]>2011-01-29 15:00:50 -0800
committerBrian Paul <[email protected]>2011-01-31 09:31:24 -0700
commit0b47d59e5be0fb5eb0277f02646914f4a55d35d5 (patch)
tree2601520605b57a0ab93f8cbf7ca1a56bd3c657fb /src/glx
parent0e8e8ba29a7cbe2fe45939cb972f437ccd21bcd5 (diff)
glx: Fix leaks in DRISW screen creation error paths.
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/drisw_glx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 237ce176176..5c7f40cdffa 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -452,8 +452,10 @@ driCreateScreen(int screen, struct glx_display *priv)
return NULL;
memset(psc, 0, sizeof *psc);
- if (!glx_screen_init(&psc->base, screen, priv))
- return NULL;
+ if (!glx_screen_init(&psc->base, screen, priv)) {
+ Xfree(psc);
+ return NULL;
+ }
psc->driver = driOpenSwrast();
if (psc->driver == NULL)
@@ -504,6 +506,7 @@ driCreateScreen(int screen, struct glx_display *priv)
handle_error:
if (psc->driver)
dlclose(psc->driver);
+ glx_screen_cleanup(&psc->base);
Xfree(psc);
ErrorMessageF("reverting to indirect rendering\n");