Date: Sun, 15 Feb 2015 14:25:00 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278802 - head/sys/fs/ext2fs Message-ID: <201502151425.t1FEP0QV066133@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502151425.t1FEP0QV066133>