From: Emil Velikov Date: Fri, 7 Nov 2014 03:45:07 +0000 (+0000) Subject: gbm/dri: cleanup memory leak on teardown X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6432c4d72e17a106e95dab98fabf43a43a501a9;p=mesa.git 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 --- diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index f637e323db9..066426617ba 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);