diff options
| author | Peter LaFosse <peter@vector35.com> | 2018-10-19 00:00:00 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2018-10-19 10:05:09 -0400 |
| commit | f0b34389d710dc2d7b7ca23cb0528e44ec0bb131 (patch) | |
| tree | 954bbb990c5447cd3badd82adb781438081255b1 /binaryview.cpp | |
| parent | 09b6de79ef14ee3eb5ee14d0bbb4cbebcddee2a1 (diff) | |
Fix memory leak in namespaces
Diffstat (limited to 'binaryview.cpp')
| -rw-r--r-- | binaryview.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp index dfb79189..f0fdb70c 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -1430,6 +1430,7 @@ Ref<Symbol> BinaryView::GetSymbolByRawName(const string& name, const NameSpace& { BNNameSpace ns = nameSpace.GetAPIObject(); BNSymbol* sym = BNGetSymbolByRawName(m_object, name.c_str(), &ns); + NameSpace::FreeAPIObject(&ns); if (!sym) return nullptr; return new Symbol(sym); @@ -1441,6 +1442,7 @@ vector<Ref<Symbol>> BinaryView::GetSymbolsByName(const string& name, const NameS size_t count; BNNameSpace ns = nameSpace.GetAPIObject(); BNSymbol** syms = BNGetSymbolsByName(m_object, name.c_str(), &count, &ns); + NameSpace::FreeAPIObject(&ns); vector<Ref<Symbol>> result; result.reserve(count); @@ -1457,6 +1459,7 @@ vector<Ref<Symbol>> BinaryView::GetSymbols(const NameSpace& nameSpace) size_t count; BNNameSpace ns = nameSpace.GetAPIObject(); BNSymbol** syms = BNGetSymbols(m_object, &count, &ns); + NameSpace::FreeAPIObject(&ns); vector<Ref<Symbol>> result; result.reserve(count); @@ -1473,6 +1476,7 @@ vector<Ref<Symbol>> BinaryView::GetSymbols(uint64_t start, uint64_t len, const N size_t count; BNNameSpace ns = nameSpace.GetAPIObject(); BNSymbol** syms = BNGetSymbolsInRange(m_object, start, len, &count, &ns); + NameSpace::FreeAPIObject(&ns); vector<Ref<Symbol>> result; result.reserve(count); @@ -1489,6 +1493,7 @@ vector<Ref<Symbol>> BinaryView::GetSymbolsOfType(BNSymbolType type, const NameSp size_t count; BNNameSpace ns = nameSpace.GetAPIObject(); BNSymbol** syms = BNGetSymbolsOfType(m_object, type, &count, &ns); + NameSpace::FreeAPIObject(&ns); vector<Ref<Symbol>> result; result.reserve(count); @@ -1505,6 +1510,7 @@ vector<Ref<Symbol>> BinaryView::GetSymbolsOfType(BNSymbolType type, uint64_t sta size_t count; BNNameSpace ns = nameSpace.GetAPIObject(); BNSymbol** syms = BNGetSymbolsOfTypeInRange(m_object, type, start, len, &count, &ns); + NameSpace::FreeAPIObject(&ns); vector<Ref<Symbol>> result; result.reserve(count); |
