Commit d5f7875
committed
fix(test): fix double-free in HandleDetachAttach test
- Problem: calling h2.release() followed by shm::remove(id) causes use-after-free
- h2.release() internally calls shm::release(id) which frees the id structure
- shm::remove(id) then accesses the freed id pointer -> crash
- Solution: detach the id from handle first, then call shm::remove(id)
- h2.detach() returns the id without releasing it
- shm::remove(id) can then safely clean up both memory and disk file
- This completes the fix for all ShmTest double-free issues1 parent 0ecf1a4 commit d5f7875
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
410 | | - | |
411 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| |||
0 commit comments