From: Bryan Cain Date: Sat, 30 Apr 2011 00:00:24 +0000 (-0500) Subject: mesa: fix segfault when no Mesa IR is generated X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e5fd8e480b661c1ab748c2ded587650ea7f3d20;p=mesa.git mesa: fix segfault when no Mesa IR is generated --- 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); }