summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorMark Rowe <mrowe@bdash.net.nz>2024-11-12 15:29:46 -0800
committerkat <kat@vector35.com>2024-11-13 16:18:10 -0500
commit0d27f74bd457689b9930614cfdca1c50d392203f (patch)
treedd31badb516139193439b9bdb4074d18169b5a1e /python/function.py
parentf6e5f01b4b1b1e4a5736f9eb78049ae1125b47f8 (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/function.py')
0 files changed, 0 insertions, 0 deletions