diff options
| author | Mark Rowe <mrowe@bdash.net.nz> | 2024-11-12 15:29:46 -0800 |
|---|---|---|
| committer | kat <kat@vector35.com> | 2024-11-13 16:18:10 -0500 |
| commit | 0d27f74bd457689b9930614cfdca1c50d392203f (patch) | |
| tree | dd31badb516139193439b9bdb4074d18169b5a1e /python/basicblock.py | |
| parent | f6e5f01b4b1b1e4a5736f9eb78049ae1125b47f8 (diff) | |
Don't leak DataBuffers
`MMappedFileAccessor::ReadBuffer` was returning a heap-allocated
`DataBuffer`, but no callers were ever deleting it. There does not
appear to be any reason to heap allocate the `DataBuffer` as the type is
effectively a smart pointer wrapper around `BNDataBuffer`. Switch to
returning it by value instead.
Additionally, `MMappedFileAccessor::ReadBuffer` was allocating a buffer,
copying data into it, and then handing that allocation to the `DataBuffer`
constructor. The constructor copies data into a new allocation it
owns so this allocation is unnecessary and was being leaked.
Diffstat (limited to 'python/basicblock.py')
0 files changed, 0 insertions, 0 deletions
