Merge "fix possible memory leaking"
diff --git a/dir.c b/dir.c
index b09ab53..7e4a567 100644
--- a/dir.c
+++ b/dir.c
@@ -474,10 +474,12 @@
 		if (lseek64(f, off, SEEK_SET) != off) {
 			printf("off = %llu\n", off);
 			perror("Unable to lseek64");
+			free(buf);
 			return FSFATAL;
 		}
 		if (read(f, buf, last) != last) {
 			perror("Unable to read");
+			free(buf);
 			return FSFATAL;
 		}
 		last /= 32;