tools/ffhash: close file handle on error
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Jun 2013 20:52:23 +0000 (22:52 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Jun 2013 20:52:23 +0000 (22:52 +0200)
Fixes CID1026768

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tools/ffhash.c

index 8c4a9f1..00a2872 100644 (file)
@@ -89,6 +89,7 @@ static int check(char *file)
     for (;;) {
         ssize_t size = read(fd, buffer, SIZE);
         if (size < 0) {
+            close(fd);
             finish();
             printf("+READ-FAILED: %s", strerror(errno));
             ret = 2;