Free vertex program TnlData, if any. Fixes a mem leak.
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 826fb73..590f357 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -300,6 +300,13 @@
_mesa_free_parameter_list(prog->Parameters);
}
+ /* XXX this is a little ugly */
+ if (prog->Target == GL_VERTEX_PROGRAM_ARB) {
+ struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog;
+ if (vprog->TnlData)
+ _mesa_free(vprog->TnlData);
+ }
+
_mesa_free(prog);
}