summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nouveau/nouveau_compiler.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c b/src/gallium/drivers/nouveau/nouveau_compiler.c
index 5f1e35a0d24..ac22035ca82 100644
--- a/src/gallium/drivers/nouveau/nouveau_compiler.c
+++ b/src/gallium/drivers/nouveau/nouveau_compiler.c
@@ -173,9 +173,9 @@ main(int argc, char *argv[])
return 1;
}
- fread(text, 1, sizeof(text), f);
- if (ferror(f)) {
+ if (!fread(text, 1, sizeof(text), f) || ferror(f)) {
_debug_printf("Error reading file '%s'\n", filename);
+ fclose(f);
return 1;
}
fclose(f);