OSDN Git Service

Close device and free super block on failure to read boot sector.
authorrelan <relan@users.noreply.github.com>
Tue, 6 Aug 2013 19:54:09 +0000 (19:54 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:16 +0000 (08:26 +0300)
libexfat/mount.c

index f671686..d10fc98 100644 (file)
@@ -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;
        }