aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/shader/slang/slang_link.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-22 18:18:58 +0000
committermarha <marha@users.sourceforge.net>2009-12-22 18:18:58 +0000
commit3b79162ea5c5be078326f2e0ea85b0f84c02f166 (patch)
tree6826d1ef026f16ec12d35ee6bd4a892d0a05b7e0 /mesalib/src/mesa/shader/slang/slang_link.c
parent4284aeba874b9168f2228c59639bec8346a56796 (diff)
parentb729d9e1cc1c60e415da24143cabcbaccb525ed7 (diff)
downloadvcxsrv-3b79162ea5c5be078326f2e0ea85b0f84c02f166.tar.gz
vcxsrv-3b79162ea5c5be078326f2e0ea85b0f84c02f166.tar.bz2
vcxsrv-3b79162ea5c5be078326f2e0ea85b0f84c02f166.zip
svn merge ^/branches/released
Diffstat (limited to 'mesalib/src/mesa/shader/slang/slang_link.c')
-rw-r--r--mesalib/src/mesa/shader/slang/slang_link.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mesalib/src/mesa/shader/slang/slang_link.c b/mesalib/src/mesa/shader/slang/slang_link.c
index 8f2b40d5d..144c12652 100644
--- a/mesalib/src/mesa/shader/slang/slang_link.c
+++ b/mesalib/src/mesa/shader/slang/slang_link.c
@@ -104,7 +104,7 @@ link_varying_vars(GLcontext *ctx,
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;
@@ -135,6 +135,7 @@ link_varying_vars(GLcontext *ctx,
&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)) {
@@ -142,6 +143,7 @@ link_varying_vars(GLcontext *ctx,
_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)) {
@@ -149,6 +151,7 @@ link_varying_vars(GLcontext *ctx,
_mesa_snprintf(msg, sizeof(msg),
"invariant modifier mismatch for '%s'", var->Name);
link_error(shProg, msg);
+ _mesa_free(map);
return GL_FALSE;
}
}
@@ -160,6 +163,7 @@ link_varying_vars(GLcontext *ctx,
if (shProg->Varying->NumParameters > ctx->Const.MaxVarying) {
link_error(shProg, "Too many varying variables");
+ _mesa_free(map);
return GL_FALSE;
}
@@ -199,7 +203,7 @@ link_varying_vars(GLcontext *ctx,
}
}
- free(map);
+ _mesa_free(map);
/* these will get recomputed before linking is completed */
prog->InputsRead = 0x0;
@@ -670,6 +674,7 @@ get_main_shader(GLcontext *ctx,
!shader->Main ||
shader->UnresolvedRefs) {
link_error(shProg, "Unresolved symbols");
+ _mesa_free_shader(ctx, shader);
return NULL;
}
}