Commit 856db37
jfs: fix metapage reference count leak in dbAllocCtl
In dbAllocCtl(), read_metapage() increases the reference count of the
metapage. However, when dp->tree.budmin < 0, the function returns -EIO
without calling release_metapage() to decrease the reference count,
leading to a memory leak.
Add release_metapage(mp) before the error return to properly manage
the metapage reference count and prevent the leak.
Fixes: a5f5e46 ("jfs: fix shift-out-of-bounds in dbSplit")
Signed-off-by: Zheng Yu <[email protected]>
Signed-off-by: Dave Kleikamp <[email protected]>1 parent b89798e commit 856db37
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1815 | 1815 | | |
1816 | 1816 | | |
1817 | 1817 | | |
1818 | | - | |
| 1818 | + | |
| 1819 | + | |
1819 | 1820 | | |
| 1821 | + | |
1820 | 1822 | | |
1821 | 1823 | | |
1822 | 1824 | | |
| |||
0 commit comments