[Mesa-dev] [PATCH 1/2] glsl/shader_cache: Fix memory leak

Bartosz Tomczyk bartosz.tomczyk86 at gmail.com
Sun Apr 2 17:31:17 UTC 2017


---
 src/compiler/glsl/shader_cache.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp
index ea1bc01f02..8c42a95664 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -1273,6 +1273,8 @@ shader_cache_write_program_metadata(struct gl_context *ctx,
 
    disk_cache_put(cache, prog->data->sha1, metadata->data, metadata->size);
 
+   if(metadata->data)
+      free(metadata->data);
    free(metadata);
 
    if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {
-- 
2.12.2



More information about the mesa-dev mailing list