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.
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.
*/
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.
*/
_mesa_memcpy (strz, str, len);
strz[len] = '\0';
- if (state->prog->String != NULL) {
- _mesa_free(state->prog->String);
- }
-
state->prog->String = strz;
state->st = _mesa_symbol_table_ctor();