From d2ab9e53453273b31a195aa3d64b10fb44d9d18b Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 27 Nov 2024 12:15:13 -0500 Subject: Fix API memory leak in data renderers and language representations --- languagerepresentation.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'languagerepresentation.cpp') 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; } -- cgit v1.3.1