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>
Tue, 17 Nov 2009 20:00:22 +0000 (12:00 -0800)
progs/util/shaderutil.c

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