Mesa (master): glsl: Fix leak of linked uniform names at relink/ free of the shader_program.

Eric Anholt anholt at kemper.freedesktop.org
Wed Jan 18 18:38:00 UTC 2012


Module: Mesa
Branch: master
Commit: aad3a46ff453d33cb3df909903d261f67b452d31
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aad3a46ff453d33cb3df909903d261f67b452d31

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan 12 13:16:33 2012 -0800

glsl: Fix leak of linked uniform names at relink/free of the shader_program.

NOTE: This is a candidate for the 8.0 branch.

---

 src/glsl/link_uniforms.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 02f57d9..d51850c 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -287,7 +287,7 @@ private:
 	 this->uniforms[id].sampler = ~0;
       }
 
-      this->uniforms[id].name = strdup(name);
+      this->uniforms[id].name = ralloc_strdup(this->uniforms, name);
       this->uniforms[id].type = base_type;
       this->uniforms[id].initialized = 0;
       this->uniforms[id].num_driver_storage = 0;




More information about the mesa-commit mailing list