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=11905da8836822f7dd60c84b5eefc72e46c94b50;p=mesa.git progs/util: Fix memory leak if fread returns 0 in CompileShaderFile. --- diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index af50d64f510..aebf23a78c8 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -95,6 +95,7 @@ CompileShaderFile(GLenum shaderType, const char *filename) shader = CompileShaderText(shaderType, buffer); } else { + fclose(f); free(buffer); return 0; }