progs/util: Fix memory leak if fread returns 0 in CompileShaderFile.
authorVinson Lee <vlee@vmware.com>
Tue, 17 Nov 2009 20:00:22 +0000 (12:00 -0800)
committerVinson Lee <vlee@vmware.com>
Sat, 5 Dec 2009 01:35:00 +0000 (17:35 -0800)
(cherry picked from commit 11905da8836822f7dd60c84b5eefc72e46c94b50)

progs/util/shaderutil.c

index 36e07842c6d0f98e78f2e2c1c8e764b16fa45229..adcf2149e2121de285dbb18a6ff57daf13f26f38 100644 (file)
@@ -99,6 +99,7 @@ CompileShaderFile(GLenum shaderType, const char *filename)
       shader = CompileShaderText(shaderType, buffer);
    }
    else {
+      fclose(f);
       free(buffer);
       return 0;
    }