From f6432c4d72e17a106e95dab98fabf43a43a501a9 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Fri, 7 Nov 2014 03:45:07 +0000 Subject: 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 Reviewed-and-tested-by: Kenneth Graunke --- src/gbm/backends/dri/gbm_dri.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gbm/backends') 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); -- cgit v1.2.3