mesa: fix minor mem leak
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 4 Sep 2008 21:05:03 +0000 (15:05 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 4 Sep 2008 21:05:03 +0000 (15:05 -0600)
src/mesa/shader/prog_print.c

index 10c5afec189114cb8d947c474c361c22f6b7cb92..ec260f18a9ff3c0eab701af4e2b64b338c98130f 100644 (file)
@@ -250,7 +250,9 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode,
          {
             struct gl_program_parameter *param
                = prog->Parameters->Parameters + index;
-            sprintf(str, _mesa_program_state_string(param->StateIndexes));
+            char *state = _mesa_program_state_string(param->StateIndexes);
+            sprintf(str, state);
+            _mesa_free(state);
          }
          break;
       case PROGRAM_ADDRESS: