Blame SOURCES/libjpeg-turbo-coverity.patch

8703cb
diff --git a/md5/md5hl.c b/md5/md5hl.c
8703cb
index 983ea76..1b5ced2 100644
8703cb
--- a/md5/md5hl.c
8703cb
+++ b/md5/md5hl.c
8703cb
@@ -75,14 +75,18 @@ MD5FileChunk(const char *filename, char *buf, off_t ofs, off_t len)
8703cb
 #endif
8703cb
 	if (f < 0)
8703cb
 		return 0;
8703cb
-	if (fstat(f, &stbuf) < 0)
8703cb
+	if (fstat(f, &stbuf) < 0) {
8703cb
+		close(f);
8703cb
 		return 0;
8703cb
+	}
8703cb
 	if (ofs > stbuf.st_size)
8703cb
 		ofs = stbuf.st_size;
8703cb
 	if ((len == 0) || (len > stbuf.st_size - ofs))
8703cb
 		len = stbuf.st_size - ofs;
8703cb
-	if (lseek(f, ofs, SEEK_SET) < 0)
8703cb
+	if (lseek(f, ofs, SEEK_SET) < 0) {
8703cb
+		close(f);
8703cb
 		return 0;
8703cb
+	}
8703cb
 	n = len;
8703cb
 	i = 0;
8703cb
 	while (n > 0) {