summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-01-05 15:34:23 +0000
committertrasz <trasz@FreeBSD.org>2015-01-05 15:34:23 +0000
commit857142e448af9e73d707aeb95a837520a9df3aa7 (patch)
treeacf15aceaeac23ff3631a19972468ec9eacd990f
parent3964cbfb9112eaf807480c58fdf16e9679f18037 (diff)
downloadFreeBSD-src-857142e448af9e73d707aeb95a837520a9df3aa7.zip
FreeBSD-src-857142e448af9e73d707aeb95a837520a9df3aa7.tar.gz
Fix memory leaks.
CID: 1258582, 1258583. MFC after: 1 month Sponsored by: The FreeBSD Foundation
-rw-r--r--usr.sbin/fstyp/ext2fs.c1
-rw-r--r--usr.sbin/fstyp/ntfs.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/fstyp/ext2fs.c b/usr.sbin/fstyp/ext2fs.c
index df9e66e..09336e5 100644
--- a/usr.sbin/fstyp/ext2fs.c
+++ b/usr.sbin/fstyp/ext2fs.c
@@ -85,6 +85,7 @@ fstyp_ext2fs(FILE *fp, char *label, size_t size)
}
strlcpy(label, s_volume_name, size);
+ free(fs);
return (0);
}
diff --git a/usr.sbin/fstyp/ntfs.c b/usr.sbin/fstyp/ntfs.c
index c0a5c5c..9058410 100644
--- a/usr.sbin/fstyp/ntfs.c
+++ b/usr.sbin/fstyp/ntfs.c
@@ -108,7 +108,7 @@ fstyp_ntfs(FILE *fp, char *label, size_t size)
bf = (struct ntfs_bootfile *)read_buf(fp, 0, 512);
if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0)
- return (1);
+ goto fail;
mftrecsz = bf->bf_mftrecsz;
recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz);
OpenPOWER on IntegriCloud