summaryrefslogtreecommitdiff
path: root/languagerepresentation.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2024-11-27 12:15:13 -0500
committerRusty Wagner <rusty.wagner@gmail.com>2024-11-28 12:16:34 -0500
commitd2ab9e53453273b31a195aa3d64b10fb44d9d18b (patch)
tree44c07eec4fb039b8995d15383882714784a6a281 /languagerepresentation.cpp
parent98ba687dfcc26bef50728cbcf04d6224513ac008 (diff)
Fix API memory leak in data renderers and language representations
Diffstat (limited to 'languagerepresentation.cpp')
-rw-r--r--languagerepresentation.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/languagerepresentation.cpp b/languagerepresentation.cpp
index 6e3bf01b..0930c0b8 100644
--- a/languagerepresentation.cpp
+++ b/languagerepresentation.cpp
@@ -387,8 +387,13 @@ BNDisassemblyTextLine* LanguageRepresentationFunctionType::GetFunctionTypeTokens
}
-void LanguageRepresentationFunctionType::FreeLinesCallback(void*, BNDisassemblyTextLine* lines, size_t)
+void LanguageRepresentationFunctionType::FreeLinesCallback(void*, BNDisassemblyTextLine* lines, size_t count)
{
+ for (size_t i = 0; i < count; i++)
+ {
+ InstructionTextToken::FreeInstructionTextTokenList(lines[i].tokens, lines[i].count);
+ Tag::FreeTagList(lines[i].tags, lines[i].tagCount);
+ }
delete[] lines;
}