[Mesa-dev] [PATCH 3/3] gbm/dri: cleanup memory leak on teardown
Emil Velikov
emil.l.velikov at gmail.com
Thu Nov 6 19:50:44 PST 2014
During teardown we free the driver_configs list pointer, but we forget
to deallocate each config in that list.
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
src/gbm/backends/dri/gbm_dri.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index f637e32..0664266 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -914,8 +914,11 @@ static void
dri_destroy(struct gbm_device *gbm)
{
struct gbm_dri_device *dri = gbm_dri_device(gbm);
+ unsigned i;
dri->core->destroyScreen(dri->screen);
+ for (i = 0; dri->driver_configs[i]; i++)
+ free((__DRIconfig *) dri->driver_configs[i]);
free(dri->driver_configs);
dlclose(dri->driver);
free(dri->base.driver_name);
--
2.1.3
More information about the mesa-dev
mailing list