aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/fstyp
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2015-01-05 15:34:23 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2015-01-05 15:34:23 +0000
commit3d2b0910d2312b7704d89bc9a3207c743d958fd6 (patch)
treeacf15aceaeac23ff3631a19972468ec9eacd990f /usr.sbin/fstyp
parentb28def217166b1626751ef9fc6c40e604ecce378 (diff)
downloadsrc-3d2b0910d2312b7704d89bc9a3207c743d958fd6.tar.gz
src-3d2b0910d2312b7704d89bc9a3207c743d958fd6.zip
Fix memory leaks.
CID: 1258582, 1258583. MFC after: 1 month Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=276704
Diffstat (limited to 'usr.sbin/fstyp')
-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 df9e66e9155a..09336e5e95be 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 c0a5c5c35f52..905841045e7d 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);