From bc5c231dc66a4ed4cfeb416c42c42da7829316d9 Mon Sep 17 00:00:00 2001 From: relan Date: Sat, 12 Nov 2016 09:48:06 +0300 Subject: Fix memory leak on error path when directory read fails. --- libexfat/node.c | 1 + 1 file changed, 1 insertion(+) 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; } -- cgit v1.2.3