svn commit: r278802 - head/sys/fs/ext2fs
Pedro F. Giffuni
pfg at FreeBSD.org
Sun Feb 15 14:25:01 UTC 2015
Author: pfg
Date: Sun Feb 15 14:25:00 2015
New Revision: 278802
URL: https://svnweb.freebsd.org/changeset/base/278802
Log:
ext2fs: Plug small memory leak
free() e2fs_contigdirs upon error.
Undo zeroing of e2fs_gd as this was actually a false positive.
X-MFC with: 278790
Modified:
head/sys/fs/ext2fs/ext2_vfsops.c
Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vfsops.c Sun Feb 15 13:57:44 2015 (r278801)
+++ head/sys/fs/ext2fs/ext2_vfsops.c Sun Feb 15 14:25:00 2015 (r278802)
@@ -363,7 +363,7 @@ compute_sb_data(struct vnode *devvp, str
db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb;
fs->e2fs_gdbcount = db_count;
fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize,
- M_EXT2MNT, M_WAITOK | M_ZERO);
+ M_EXT2MNT, M_WAITOK);
fs->e2fs_contigdirs = malloc(fs->e2fs_gcount *
sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK | M_ZERO);
@@ -379,6 +379,7 @@ compute_sb_data(struct vnode *devvp, str
fsbtodb(fs, logic_sb_block + i + 1 ),
fs->e2fs_bsize, NOCRED, &bp);
if (error) {
+ free(fs->e2fs_contigdirs, M_EXT2MNT);
free(fs->e2fs_gd, M_EXT2MNT);
brelse(bp);
return (error);
More information about the svn-src-all
mailing list