Mesa (mesa_7_6_branch): progs/util: Fix memory leak if fread returns 0 in CompileShaderFile.

Vinson Lee vlee at kemper.freedesktop.org
Fri Dec 4 17:35:33 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 4fb5ae7233e5c358e579ced6155f32461f6edf2d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4fb5ae7233e5c358e579ced6155f32461f6edf2d

Author: Vinson Lee <vlee at vmware.com>
Date:   Tue Nov 17 12:00:22 2009 -0800

progs/util: Fix memory leak if fread returns 0 in CompileShaderFile.
(cherry picked from commit 11905da8836822f7dd60c84b5eefc72e46c94b50)

---

 progs/util/shaderutil.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c
index 36e0784..adcf214 100644
--- a/progs/util/shaderutil.c
+++ b/progs/util/shaderutil.c
@@ -99,6 +99,7 @@ CompileShaderFile(GLenum shaderType, const char *filename)
       shader = CompileShaderText(shaderType, buffer);
    }
    else {
+      fclose(f);
       free(buffer);
       return 0;
    }



More information about the mesa-commit mailing list