summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-05-18 09:19:00 -0400
committerRob Clark <[email protected]>2016-05-18 09:20:22 -0400
commit5827a1dc4b3c2f51d45f4b1d6ccd080515ed2bcc (patch)
treeacf4c8233d0c203c916aa3e6cd4447b466643cc8 /src/mesa/state_tracker
parent877a8026c7e1d729356eb6b6dfadfe358bbe23d1 (diff)
mesa/st: don't leak name
Pointed out by coverity. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_nir_lower_builtin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_nir_lower_builtin.c b/src/mesa/state_tracker/st_nir_lower_builtin.c
index b4da9017d5c..20b04d1e20f 100644
--- a/src/mesa/state_tracker/st_nir_lower_builtin.c
+++ b/src/mesa/state_tracker/st_nir_lower_builtin.c
@@ -128,9 +128,12 @@ get_variable(lower_builtin_state *state, nir_deref_var *deref,
char *name = _mesa_program_state_string((gl_state_index *)tokens);
- nir_foreach_variable(var, &shader->uniforms)
- if (strcmp(var->name, name) == 0)
+ nir_foreach_variable(var, &shader->uniforms) {
+ if (strcmp(var->name, name) == 0) {
+ free(name);
return var;
+ }
+ }
/* variable doesn't exist yet, so create it: */
nir_variable *var =