From 6697a9d2ce4bf7d544f98dafea7edfaecd7b6731 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 14 Apr 2025 08:33:03 -0400 Subject: Fix memory leaks in Sections, Segments, Settings, ExternalLibrary, and BackgroundTask --- python/binaryview.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index 989c1f20..092f9bef 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -9545,9 +9545,7 @@ to a the type "tagRECT" found in the typelibrary "winX64common" seg = core.BNGetSegmentAt(self.handle, addr) if not seg: return None - segment_handle = core.BNNewSegmentReference(seg) - assert segment_handle is not None, "core.BNNewSegmentReference returned None" - return Segment(segment_handle) + return Segment(seg) def get_address_for_data_offset(self, offset: int) -> Optional[int]: """ @@ -9639,9 +9637,7 @@ to a the type "tagRECT" found in the typelibrary "winX64common" section = core.BNGetSectionByName(self.handle, name) if section is None: return None - section_handle = core.BNNewSectionReference(section) - assert section_handle is not None, "core.BNNewSectionReference returned None" - result = Section(section_handle) + result = Section(section) return result def get_unique_section_names(self, name_list: List[str]) -> List[str]: -- cgit v1.3.1