From: relan Date: Tue, 6 Aug 2013 19:54:09 +0000 (+0000) Subject: Close device and free super block on failure to read boot sector. X-Git-Tag: android-x86-6.0-r1~76 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fexternal-exfat.git;a=commitdiff_plain;h=30042f421cc61807fb37135184ee66114df71c1e Close device and free super block on failure to read boot sector. --- diff --git a/libexfat/mount.c b/libexfat/mount.c index f671686..d10fc98 100644 --- a/libexfat/mount.c +++ b/libexfat/mount.c @@ -189,6 +189,8 @@ int exfat_mount(struct exfat* ef, const char* spec, const char* options) if (exfat_pread(ef->dev, ef->sb, sizeof(struct exfat_super_block), 0) < 0) { + exfat_close(ef->dev); + free(ef->sb); exfat_error("failed to read boot sector"); return -EIO; }