summaryrefslogtreecommitdiff
path: root/architecture.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2019-01-12 13:16:12 -0500
committerPeter LaFosse <peter@vector35.com>2019-01-12 13:16:24 -0500
commit22c2a49db23efa53b04a8e5587749affa716ce2d (patch)
tree332d7392643c8c3709b850ce19116ce15d4640ce /architecture.cpp
parent9e5ded10703110ff1af7d1efc0d39c95ed6f0568 (diff)
Fix memory leak when allocaing BNInstructionTextToken
Diffstat (limited to 'architecture.cpp')
-rw-r--r--architecture.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/architecture.cpp b/architecture.cpp
index da0366cf..f7ec2d01 100644
--- a/architecture.cpp
+++ b/architecture.cpp
@@ -228,7 +228,12 @@ bool Architecture::GetInstructionTextCallback(void* ctxt, const uint8_t* data, u
void Architecture::FreeInstructionTextCallback(BNInstructionTextToken* tokens, size_t count)
{
for (size_t i = 0; i < count; i++)
+ {
BNFreeString(tokens[i].text);
+ for (size_t j = 0; j < tokens[j].namesCount; j++)
+ BNFreeString(tokens[i].typeNames[j]);
+ delete[] tokens[i].typeNames;
+ }
delete[] tokens;
}