summaryrefslogtreecommitdiff
path: root/src/mesa/shader/arbprogparse.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-11-05 14:17:07 -0800
committerIan Romanick <ian.d.romanick@intel.com>2009-11-06 10:46:22 -0800
commitd8e256f9236d3e9dfd433c3a59718f0fdf1ca79a (patch)
treee6111bb2a9f1b6498fed1ef7f4f0000752760d45 /src/mesa/shader/arbprogparse.c
parent301a9b7e28f7404b8f6d8c34649f0035b49a8249 (diff)
ARB prog parser: Release old program string in _mesa_parse_arb_{fragment,vertex}_program
The program structure passed to _mesa_parse_arb_program is just a place holder. The stings that actually need to be released are only known to the functions calling _mesa_parse_arb_program, so they should be freed there.
Diffstat (limited to 'src/mesa/shader/arbprogparse.c')
-rw-r--r--src/mesa/shader/arbprogparse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 05ee4f563e..dd732b6666 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -87,6 +87,9 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
return;
}
+ if (program->Base.String != NULL)
+ _mesa_free(program->Base.String);
+
/* Copy the relevant contents of the arb_program struct into the
* fragment_program struct.
*/
@@ -178,6 +181,9 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
return;
}
+ if (program->Base.String != NULL)
+ _mesa_free(program->Base.String);
+
/* Copy the relevant contents of the arb_program struct into the
* vertex_program struct.
*/