Mesa (master): glsl: Also strdup the names of uniform list entries for > vec4 types.

Eric Anholt anholt at kemper.freedesktop.org
Thu Aug 19 00:45:38 UTC 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Aug 18 17:39:57 2010 -0700

glsl: Also strdup the names of uniform list entries for >vec4 types.

Fixes double-free since the fix to free all of the uniform list.

---

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

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index b256574..2dc5697 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -843,7 +843,7 @@ assign_uniform_locations(struct gl_shader_program *prog)
 
 	    n->u[0].Name = strdup(var->name);
 	    for (unsigned j = 1; j < vec4_slots; j++)
-	       n->u[j].Name = n->u[0].Name;
+	       n->u[j].Name = strdup(var->name);
 
 	    hash_table_insert(ht, n, n->u[0].Name);
 	    uniforms.push_tail(& n->link);




More information about the mesa-commit mailing list