aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/prog_instruction.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/program/prog_instruction.c')
-rw-r--r--mesalib/src/mesa/program/prog_instruction.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mesalib/src/mesa/program/prog_instruction.c b/mesalib/src/mesa/program/prog_instruction.c
index 5d6cb476c..d69d7b2d4 100644
--- a/mesalib/src/mesa/program/prog_instruction.c
+++ b/mesalib/src/mesa/program/prog_instruction.c
@@ -69,7 +69,7 @@ _mesa_init_instructions(struct prog_instruction *inst, GLuint count)
struct prog_instruction *
_mesa_alloc_instructions(GLuint numInst)
{
- return (struct prog_instruction *)
+ return
calloc(1, numInst * sizeof(struct prog_instruction));
}
@@ -127,10 +127,8 @@ _mesa_free_instructions(struct prog_instruction *inst, GLuint count)
{
GLuint i;
for (i = 0; i < count; i++) {
- if (inst[i].Data)
- free(inst[i].Data);
- if (inst[i].Comment)
- free((char *) inst[i].Comment);
+ free(inst[i].Data);
+ free((char *)inst[i].Comment);
}
free(inst);
}