aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program/program.c')
-rw-r--r--src/mesa/program/program.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 78efca9f122..224446a2683 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -388,8 +388,9 @@ _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
if (prog->String)
free(prog->String);
- _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
-
+ if (prog->Instructions) {
+ _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
+ }
if (prog->Parameters) {
_mesa_free_parameter_list(prog->Parameters);
}