From: Vinson Lee Date: Tue, 17 Nov 2009 20:00:22 +0000 (-0800) Subject: progs/util: Fix memory leak if fread returns 0 in CompileShaderFile. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4fb5ae7233e5c358e579ced6155f32461f6edf2d;p=mesa.git progs/util: Fix memory leak if fread returns 0 in CompileShaderFile. (cherry picked from commit 11905da8836822f7dd60c84b5eefc72e46c94b50) --- diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 36e07842c6d..adcf2149e21 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; }