Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jan 2015 15:34:25 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276704 - head/usr.sbin/fstyp
Message-ID:  <201501051534.t05FYPHW078250@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon Jan  5 15:34:23 2015
New Revision: 276704
URL: https://svnweb.freebsd.org/changeset/base/276704

Log:
  Fix memory leaks.
  
  CID:	1258582, 1258583.
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.sbin/fstyp/ext2fs.c
  head/usr.sbin/fstyp/ntfs.c

Modified: head/usr.sbin/fstyp/ext2fs.c
==============================================================================
--- head/usr.sbin/fstyp/ext2fs.c	Mon Jan  5 15:29:28 2015	(r276703)
+++ head/usr.sbin/fstyp/ext2fs.c	Mon Jan  5 15:34:23 2015	(r276704)
@@ -85,6 +85,7 @@ fstyp_ext2fs(FILE *fp, char *label, size
 	}
 
 	strlcpy(label, s_volume_name, size);
+	free(fs);
 
 	return (0);
 }

Modified: head/usr.sbin/fstyp/ntfs.c
==============================================================================
--- head/usr.sbin/fstyp/ntfs.c	Mon Jan  5 15:29:28 2015	(r276703)
+++ head/usr.sbin/fstyp/ntfs.c	Mon Jan  5 15:34:23 2015	(r276704)
@@ -108,7 +108,7 @@ fstyp_ntfs(FILE *fp, char *label, size_t
 
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501051534.t05FYPHW078250>