diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exfat_fs.c | 4 | ||||
-rw-r--r-- | lib/libexfat.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/exfat_fs.c b/lib/exfat_fs.c index be76e59..b24f532 100644 --- a/lib/exfat_fs.c +++ b/lib/exfat_fs.c @@ -128,8 +128,10 @@ struct exfat *exfat_alloc_exfat(struct exfat_blk_dev *blk_dev, struct pbr *bs) struct exfat *exfat; exfat = calloc(1, sizeof(*exfat)); - if (!exfat) + if (!exfat) { + free(bs); return NULL; + } INIT_LIST_HEAD(&exfat->dir_list); exfat->blk_dev = blk_dev; diff --git a/lib/libexfat.c b/lib/libexfat.c index 0bcb4a4..9cc184f 100644 --- a/lib/libexfat.c +++ b/lib/libexfat.c @@ -1046,6 +1046,8 @@ int exfat_parse_ulong(const char *s, unsigned long *out) { char *endptr; + errno = 0; + *out = strtoul(s, &endptr, 0); if (errno) |