summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2021-08-17 12:24:01 +0800
committerXusheng <xusheng@vector35.com>2021-08-17 12:24:01 +0800
commit6312556eede2d80978f7f77ce8757f5290d5a900 (patch)
tree2b5430df610c14ab33aae48f4bcc777c2657f042 /binaryview.cpp
parent2d790a6c95c06359acaf9821fac919c5a3f11c18 (diff)
Fix ref count issue in BinaryView::GetCodeReferencesForTypeField()
Fix https://github.com/Vector35/binaryninja-api/issues/2590
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index db9b217b..d7040cea 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -1962,7 +1962,7 @@ vector<TypeFieldReference> BinaryView::GetCodeReferencesForTypeField(const Quali
src.addr = refs[i].addr;
src.size = refs[i].size;
BNTypeWithConfidence& tc = refs[i].incomingType;
- Ref<Type> type = tc.type ? new Type(tc.type) : nullptr;
+ Ref<Type> type = tc.type ? new Type(BNNewTypeReference(tc.type)) : nullptr;
src.incomingType = Confidence<Ref<Type>>(type, tc.confidence);
result.push_back(src);
}