diff options
| author | Mason Reed <mason@vector35.com> | 2025-02-07 00:01:02 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-02-07 00:01:02 -0500 |
| commit | 47ef9cd42471dbc4ff85affb3f6747778562a547 (patch) | |
| tree | 36a89a7465cb4ae21b3e0237c36734d6de53d636 | |
| parent | bd80e64058948c3a4e7f068f0075789ae208c353 (diff) | |
Fix Rust LinearDisassemblyLine not freeing properly
| -rw-r--r-- | rust/src/linear_view.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rust/src/linear_view.rs b/rust/src/linear_view.rs index 1c92ddaa..65447d24 100644 --- a/rust/src/linear_view.rs +++ b/rust/src/linear_view.rs @@ -469,7 +469,12 @@ impl LinearDisassemblyLine { } pub(crate) fn free_raw(value: BNLinearDisassemblyLine) { - let _ = unsafe { Function::ref_from_raw(value.function) }; + if !value.function.is_null() { + let _ = unsafe { Function::ref_from_raw(value.function) }; + } + if !value.block.is_null() { + let _ = unsafe { BasicBlock::ref_from_raw(value.block, NativeBlock::new()) }; + } DisassemblyTextLine::free_raw(value.contents); } } |
