summaryrefslogtreecommitdiff
path: root/view
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-07-15 20:14:30 -0700
committerMark Rowe <mark@vector35.com>2025-07-16 15:05:25 -0700
commit26eebf712fb54c3fa41778410547a0992702f2cf (patch)
tree6f217cda9dae0137eee06e780ef46b9e79ff32e8 /view
parent12486a2472aef8a60c5fce5b62bc516120075c36 (diff)
Miscellaneous leak fixes in MachoView and ObjCProcessor
Diffstat (limited to 'view')
-rw-r--r--view/macho/machoview.cpp5
-rw-r--r--view/macho/machoview.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/view/macho/machoview.cpp b/view/macho/machoview.cpp
index 161da798..dba8f9dc 100644
--- a/view/macho/machoview.cpp
+++ b/view/macho/machoview.cpp
@@ -264,7 +264,6 @@ MachOHeader MachoView::HeaderForAddress(BinaryView* data, uint64_t address, bool
header.isMainHeader = isMainHeader;
header.identifierPrefix = identifierPrefix;
- header.stringList = new DataBuffer();
std::string errorMsg;
if (isMainHeader) {
@@ -608,7 +607,7 @@ MachOHeader MachoView::HeaderForAddress(BinaryView* data, uint64_t address, bool
header.symtab.stroff = reader.Read32();
header.symtab.strsize = reader.Read32();
reader.Seek(header.symtab.stroff);
- header.stringList->Append(reader.Read(header.symtab.strsize));
+ header.stringList.Append(reader.Read(header.symtab.strsize));
header.stringListSize = header.symtab.strsize;
m_logger->LogDebug("\tstrsize: %08x\n" \
"\tstroff: %08x\n" \
@@ -3131,7 +3130,7 @@ void MachoView::ParseSymbolTable(BinaryReader& reader, MachOHeader& header, cons
if (sym.n_strx >= symtab.strsize || ((sym.n_type & N_TYPE) == N_INDR))
continue;
- string symbol((char*)header.stringList->GetDataAt(sym.n_strx));
+ string symbol((char*)header.stringList.GetDataAt(sym.n_strx));
m_symbols.push_back(symbol);
//otool ignores symbols that end with ".o", startwith "ltmp" or are "gcc_compiled." so do we
if (symbol == "gcc_compiled." ||
diff --git a/view/macho/machoview.h b/view/macho/machoview.h
index c05d03a8..d9c02b08 100644
--- a/view/macho/machoview.h
+++ b/view/macho/machoview.h
@@ -1413,7 +1413,7 @@ namespace BinaryNinja
linkedit_data_command chainedFixups {};
section_64 chainStarts {};
- DataBuffer* stringList;
+ DataBuffer stringList;
size_t stringListSize = 0;
uint64_t relocationBase = 0;