Commit 58bb7c8
Fix mapping leak on openExisting error path
openExisting creates the RW mapping only after the recovery scan
completes. The catch block used to close the fd but not the mapping,
so a throw between a successful Files.mmap and the constructor return
(realistically only an OOME allocating the MmapSegment) leaked the
mapping. Track the address across the try block and munmap it in the
catch before closing the fd, mirroring the cleanup pattern create()
uses.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 0a345a1 commit 58bb7c8
1 file changed
Lines changed: 5 additions & 1 deletion
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
309 | | - | |
| 310 | + | |
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
316 | 320 | | |
317 | 321 | | |
318 | 322 | | |
| |||
0 commit comments