summaryrefslogtreecommitdiff
path: root/src/gbm
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-11-07 03:45:07 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2014-11-07 18:32:07 +0000
commitf6432c4d72e17a106e95dab98fabf43a43a501a9 (patch)
treeac70d47c15e7ef8e015de868fdaabd48d5a54095 /src/gbm
parent8ed08e69bca515e6b116d0306390cdd119acc140 (diff)
gbm/dri: cleanup memory leak on teardown
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@gmail.com> Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/gbm')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index f637e323db..066426617b 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);