summaryrefslogtreecommitdiff
path: root/flowgraphnode.cpp
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2023-11-14 18:35:38 -0500
committerGlenn Smith <glenn@vector35.com>2023-11-14 18:35:38 -0500
commit4025361513068463390900635313910200542556 (patch)
tree2dbfc8ef20c3eae8d849a02d833917dc24b28d28 /flowgraphnode.cpp
parent814d840c8d12dfcfb60a5bf172ea494825fd30c1 (diff)
Fix a number of leaks and bad uses of free in the api
See https://github.com/Vector35/binaryninja-api/issues/4751
Diffstat (limited to 'flowgraphnode.cpp')
-rw-r--r--flowgraphnode.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/flowgraphnode.cpp b/flowgraphnode.cpp
index 5021e842..cf25b80c 100644
--- a/flowgraphnode.cpp
+++ b/flowgraphnode.cpp
@@ -131,7 +131,13 @@ void FlowGraphNode::SetLines(const vector<DisassemblyTextLine>& lines)
}
BNSetFlowGraphNodeLines(m_object, buf, lines.size());
- BNFreeDisassemblyTextLines(buf, lines.size());
+
+ for (size_t i = 0; i < lines.size(); i++)
+ {
+ InstructionTextToken::FreeInstructionTextTokenList(buf[i].tokens, buf[i].count);
+ Tag::FreeTagList(buf[i].tags, buf[i].tagCount);
+ }
+ delete[] buf;
m_cachedLines = lines;
m_cachedLinesValid = true;