aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelan <relan@users.noreply.github.com>2016-11-12 09:48:06 +0300
committerrelan <relan@users.noreply.github.com>2016-11-12 09:49:33 +0300
commitbc5c231dc66a4ed4cfeb416c42c42da7829316d9 (patch)
treecc5223ac45ded9fda7639342e7f340bb83e211c3
parent449b965b88d5f9b85435ba6d742b37177c508404 (diff)
downloadandroid_external_exfat-bc5c231dc66a4ed4cfeb416c42c42da7829316d9.tar.gz
android_external_exfat-bc5c231dc66a4ed4cfeb416c42c42da7829316d9.tar.bz2
android_external_exfat-bc5c231dc66a4ed4cfeb416c42c42da7829316d9.zip
Fix memory leak on error path when directory read fails.
-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;
}