diff options
author | trasz <trasz@FreeBSD.org> | 2015-01-20 20:42:55 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-01-20 20:42:55 +0000 |
commit | 1444c0c436ce1ab5136cbbdb015aabcc6ae5a251 (patch) | |
tree | 56f3179425e49812e1a803856a5afac1b1bcb311 /usr.sbin/fstyp | |
parent | 8a23a0c9e7e504d0c050b097991c204513399954 (diff) | |
download | FreeBSD-src-1444c0c436ce1ab5136cbbdb015aabcc6ae5a251.zip FreeBSD-src-1444c0c436ce1ab5136cbbdb015aabcc6ae5a251.tar.gz |
MFC r276704:
Fix memory leaks.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin/fstyp')
-rw-r--r-- | usr.sbin/fstyp/ext2fs.c | 1 | ||||
-rw-r--r-- | usr.sbin/fstyp/ntfs.c | 2 |
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); |