projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5bc2a1
)
progs/util: Fix memory leak if fail to load/compile shader
author
Vinson Lee
<vlee@vmware.com>
Tue, 3 Nov 2009 21:41:08 +0000
(14:41 -0700)
committer
Vinson Lee
<vlee@vmware.com>
Sat, 5 Dec 2009 01:32:48 +0000
(17:32 -0800)
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit
c475079ef2d901ba4506ebd53e19419cd46793ab
)
progs/util/shaderutil.c
patch
|
blob
|
history
diff --git
a/progs/util/shaderutil.c
b/progs/util/shaderutil.c
index 629b6f1d972d74e6d206e37abc45f3cc3845a439..36e07842c6d0f98e78f2e2c1c8e764b16fa45229 100644
(file)
--- a/
progs/util/shaderutil.c
+++ b/
progs/util/shaderutil.c
@@
-88,6
+88,7
@@
CompileShaderFile(GLenum shaderType, const char *filename)
f = fopen(filename, "r");
if (!f) {
fprintf(stderr, "Unable to open shader file %s\n", filename);
+ free(buffer);
return 0;
}
@@
-98,6
+99,7
@@
CompileShaderFile(GLenum shaderType, const char *filename)
shader = CompileShaderText(shaderType, buffer);
}
else {
+ free(buffer);
return 0;
}