GLuint *map, i, firstVarying, newFile;
GLbitfield *inOutFlags;
- map = (GLuint *) malloc(prog->Varying->NumParameters * sizeof(GLuint));
+ map = (GLuint *) _mesa_malloc(prog->Varying->NumParameters * sizeof(GLuint));
if (!map)
return GL_FALSE;
&shProg->Varying->Parameters[j];
if (var->Size != v->Size) {
link_error(shProg, "mismatched varying variable types");
+ _mesa_free(map);
return GL_FALSE;
}
if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) {
_mesa_snprintf(msg, sizeof(msg),
"centroid modifier mismatch for '%s'", var->Name);
link_error(shProg, msg);
+ _mesa_free(map);
return GL_FALSE;
}
if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) {
_mesa_snprintf(msg, sizeof(msg),
"invariant modifier mismatch for '%s'", var->Name);
link_error(shProg, msg);
+ _mesa_free(map);
return GL_FALSE;
}
}
if (shProg->Varying->NumParameters > ctx->Const.MaxVarying) {
link_error(shProg, "Too many varying variables");
+ _mesa_free(map);
return GL_FALSE;
}
}
}
- free(map);
+ _mesa_free(map);
/* these will get recomputed before linking is completed */
prog->InputsRead = 0x0;