Commit 336cf2a
Fix use-after-free in moveForSlabRelease fragmentation stats
Summary:
`moveForSlabRelease` called `util::getFragmentation(*this, oldItem)` after
`allocator_->free(&oldItem)`, accessing freed memory (`getSize()`,
`isChainedItem()`, `getKey()`). Move the fragmentation computation before the
`free()` call to eliminate the use-after-free.
Reviewed By: rlyerly
Differential Revision: D98666914
fbshipit-source-id: 427d5a8e460d22a3d13e4941401d7dd8b60bd3a91 parent 55626f7 commit 336cf2a
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5246 | 5246 | | |
5247 | 5247 | | |
5248 | 5248 | | |
5249 | | - | |
5250 | | - | |
5251 | 5249 | | |
5252 | 5250 | | |
| 5251 | + | |
5253 | 5252 | | |
5254 | 5253 | | |
5255 | 5254 | | |
| |||
0 commit comments