svn commit: r277436 - stable/10/usr.sbin/fstyp

Edward Tomasz Napierala trasz at FreeBSD.org
Tue Jan 20 20:42:56 UTC 2015


Author: trasz
Date: Tue Jan 20 20:42:55 2015
New Revision: 277436
URL: https://svnweb.freebsd.org/changeset/base/277436

Log:
  MFC r276704:
  
  Fix memory leaks.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/10/usr.sbin/fstyp/ext2fs.c
  stable/10/usr.sbin/fstyp/ntfs.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/fstyp/ext2fs.c
==============================================================================
--- stable/10/usr.sbin/fstyp/ext2fs.c	Tue Jan 20 20:41:32 2015	(r277435)
+++ stable/10/usr.sbin/fstyp/ext2fs.c	Tue Jan 20 20:42:55 2015	(r277436)
@@ -85,6 +85,7 @@ fstyp_ext2fs(FILE *fp, char *label, size
 	}
 
 	strlcpy(label, s_volume_name, size);
+	free(fs);
 
 	return (0);
 }

Modified: stable/10/usr.sbin/fstyp/ntfs.c
==============================================================================
--- stable/10/usr.sbin/fstyp/ntfs.c	Tue Jan 20 20:41:32 2015	(r277435)
+++ stable/10/usr.sbin/fstyp/ntfs.c	Tue Jan 20 20:42:55 2015	(r277436)
@@ -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);


More information about the svn-src-stable-10 mailing list