[Bug 265071] ext2fs: fix potential memory leak in ext4_ext_grow_indepth()

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 07 Jul 2022 06:34:01 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265071

            Bug ID: 265071
           Summary: ext2fs: fix potential memory leak in
                    ext4_ext_grow_indepth()
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: niejianglei2021@163.com

ext4_ext_grow_indepth() allocates memory chunk for "newblk" with
ext4_ext_alloc_meta(). When getblk() and bwrite() fail in this funciton,
"newblk" is not released, which will lead to a memory leak.

We should release the "newblk" with ext4_ext_blkfree() when some error
occurs to avoid the memory leak.

-- 
You are receiving this mail because:
You are the assignee for the bug.