[Mesa-dev] [PATCH 2/4] st/dri: prevent leak of dri option default values

Aaron Watry awatry at gmail.com
Thu Jan 2 10:38:04 PST 2014


CC: "10.0" <mesa-stable at lists.freedesktop.org>
---
 src/gallium/state_trackers/dri/common/dri_screen.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index 7410dbe..a657249 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -360,6 +360,10 @@ dri_destroy_option_cache(struct dri_screen * screen)
    }
 
    free(screen->optionCache.values);
+
+   //Default values are copied to screen->optionCache->values in initOptionCache
+   //The info field, however, is a pointer copy, so don't free that twice
+   free(screen->optionCacheDefaults.values);
 }
 
 void
-- 
1.8.3.2



More information about the mesa-dev mailing list