aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libexfat/node.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libexfat/node.c b/libexfat/node.c
index fa04e25..3f49fb2 100644
--- a/libexfat/node.c
+++ b/libexfat/node.c
@@ -109,6 +109,7 @@ static int opendir(struct exfat* ef, const struct exfat_node* dir,
if (exfat_pread(ef->dev, it->chunk, CLUSTER_SIZE(*ef->sb),
exfat_c2o(ef, it->cluster)) < 0)
{
+ free(it->chunk);
exfat_error("failed to read directory cluster %#x", it->cluster);
return -EIO;
}