diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2023-01-26 16:37:39 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2023-01-30 11:57:43 -0500 |
| commit | 6ed8f189b2a0607a13c2a2163d82993ca60d2a19 (patch) | |
| tree | bec8293f894c664f29edeaa64eddee609aada8b5 /function.cpp | |
| parent | a3939bdec15f9299ae9a681255fa93c47113870a (diff) | |
Fix Type object leaks
Diffstat (limited to 'function.cpp')
| -rw-r--r-- | function.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/function.cpp b/function.cpp index 41109dea..4be60124 100644 --- a/function.cpp +++ b/function.cpp @@ -794,7 +794,7 @@ Ref<Type> Function::GetType() const Confidence<Ref<Type>> Function::GetReturnType() const { BNTypeWithConfidence tc = BNGetFunctionReturnType(m_object); - Ref<Type> type = tc.type ? new Type(BNNewTypeReference(tc.type)) : nullptr; + Ref<Type> type = tc.type ? new Type(tc.type) : nullptr; return Confidence<Ref<Type>>(type, tc.confidence); } @@ -1501,7 +1501,7 @@ Confidence<Ref<Type>> Function::GetVariableType(const Variable& var) BNTypeWithConfidence type = BNGetVariableType(m_object, &var); if (!type.type) return nullptr; - return Confidence<Ref<Type>>(new Type(BNNewTypeReference(type.type)), type.confidence); + return Confidence<Ref<Type>>(new Type(type.type), type.confidence); } @@ -1706,7 +1706,7 @@ void Function::SetUserCallRegisterStackAdjustment( Confidence<Ref<Type>> Function::GetCallTypeAdjustment(Architecture* arch, uint64_t addr) { BNTypeWithConfidence result = BNGetCallTypeAdjustment(m_object, arch->GetObject(), addr); - return Confidence<Ref<Type>>(result.type ? new Type(BNNewTypeReference(result.type)) : nullptr, result.confidence); + return Confidence<Ref<Type>>(result.type ? new Type(result.type) : nullptr, result.confidence); } @@ -1778,7 +1778,7 @@ Ref<Type> Function::GetIntegerConstantDisplayTypeEnumType( { BNType* apiType = BNGetIntegerConstantDisplayTypeEnumerationType(m_object, arch->GetObject(), instrAddr, value, operand); if (apiType) - return new Type(BNNewTypeReference(apiType)); + return new Type(apiType); return nullptr; } |
