projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ceb6728
)
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
Brian Paul
<brianp@vmware.com>
Tue, 3 Nov 2009 21:49:41 +0000
(14:49 -0700)
Signed-off-by: Brian Paul <brianp@vmware.com>
progs/util/shaderutil.c
patch
|
blob
|
history
diff --git
a/progs/util/shaderutil.c
b/progs/util/shaderutil.c
index 4db950016b890149506250f2f66c3cb723733edb..af50d64f510ce86d2115abb3a737f160bc624209 100644
(file)
--- a/
progs/util/shaderutil.c
+++ b/
progs/util/shaderutil.c
@@
-84,6
+84,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;
}
@@
-94,6
+95,7
@@
CompileShaderFile(GLenum shaderType, const char *filename)
shader = CompileShaderText(shaderType, buffer);
}
else {
+ free(buffer);
return 0;
}