From c1075d6af72cf3a6d137d52ad8d7d168633efb7a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 2 Jun 2013 22:52:23 +0200 Subject: [PATCH] tools/ffhash: close file handle on error Fixes CID1026768 Signed-off-by: Michael Niedermayer --- tools/ffhash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ffhash.c b/tools/ffhash.c index 8c4a9f1b0b..00a2872717 100644 --- a/tools/ffhash.c +++ b/tools/ffhash.c @@ -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;