From 6ed8f189b2a0607a13c2a2163d82993ca60d2a19 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 26 Jan 2023 16:37:39 -0500 Subject: Fix Type object leaks --- platform.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'platform.cpp') diff --git a/platform.cpp b/platform.cpp index c4d65274..e7f3aef5 100644 --- a/platform.cpp +++ b/platform.cpp @@ -381,7 +381,7 @@ Ref Platform::GetTypeByName(const QualifiedName& name) QualifiedName::FreeAPIObject(&nameObj); if (!type) return nullptr; - return new Type(BNNewTypeReference(type)); + return new Type(type); } @@ -392,7 +392,7 @@ Ref Platform::GetVariableByName(const QualifiedName& name) QualifiedName::FreeAPIObject(&nameObj); if (!type) return nullptr; - return new Type(BNNewTypeReference(type)); + return new Type(type); } @@ -403,7 +403,7 @@ Ref Platform::GetFunctionByName(const QualifiedName& name, bool exactMatch QualifiedName::FreeAPIObject(&nameObj); if (!type) return nullptr; - return new Type(BNNewTypeReference(type)); + return new Type(type); } @@ -421,7 +421,7 @@ Ref Platform::GetSystemCallType(uint32_t n) BNType* type = BNGetPlatformSystemCallType(m_object, n); if (!type) return nullptr; - return new Type(BNNewTypeReference(type)); + return new Type(type); } -- cgit v1.3.1