summaryrefslogtreecommitdiffstats
path: root/src/hash.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2013-01-14 19:30:10 +0100
committerPali Rohár <pali.rohar@gmail.com>2013-01-14 19:30:10 +0100
commita6ec475a92ebfb9ab42685cb63b42a39656705ab (patch)
treee18051a5a7514511a72a52cb6dc57965c1b21d28 /src/hash.c
parent783222ed007f93d16bfb224df3d10ddb47bf4a74 (diff)
parenta6ef73359c0e0537ebf83795ebacbbfaee2c9c28 (diff)
download0xFFFF-a6ec475a92ebfb9ab42685cb63b42a39656705ab.tar.bz2
Merge branch 'pvc' into legacylegacy
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c
index 9090bad..cc17492 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -44,8 +44,10 @@ usho do_hash_file(const char *filename, const char *type)
do {
ret = fread(&buf, 1, BSIZE, fd);
- if (ret == -1)
+ if (ret == -1) {
+ fclose(fd);
return 0;
+ }
hash ^= do_hash((usho *)&buf, ret);
} while(ret);