Skip to content

Ghidra is a software reverse engineering (SRE) framework

fixed memory leak

caheckmana1c189862438
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
index cd5c1cf472..d1ba9e89ce 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc
@@ -835,6 +835,8 @@ void MapState::reconcileDatatypes(void)
startDatatype = curDatatype;
if (curHint->compare(*newList.back()) != 0)
newList.push_back(curHint); // Keep the current hint if it is otherwise different
+ else
+ delete curHint; // RangeHint is on the heap, so delete if we are not keeping it
}
else {
while(startPos < newList.size()) {