summaryrefslogtreecommitdiff
path: root/python/variable.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2023-01-26 16:37:39 -0500
committerRusty Wagner <rusty.wagner@gmail.com>2023-01-30 11:57:43 -0500
commit6ed8f189b2a0607a13c2a2163d82993ca60d2a19 (patch)
treebec8293f894c664f29edeaa64eddee609aada8b5 /python/variable.py
parenta3939bdec15f9299ae9a681255fa93c47113870a (diff)
Fix Type object leaks
Diffstat (limited to 'python/variable.py')
-rw-r--r--python/variable.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/python/variable.py b/python/variable.py
index 14929557..ee0d93a4 100644
--- a/python/variable.py
+++ b/python/variable.py
@@ -728,9 +728,7 @@ class Variable(CoreVariable):
def type(self) -> Optional['binaryninja.types.Type']:
var_type_conf = core.BNGetVariableType(self._function.handle, self.to_BNVariable())
if var_type_conf.type:
- ref_handle = core.BNNewTypeReference(var_type_conf.type)
- assert ref_handle is not None, f"core.BNNewTypeReference returned None {var_type_conf} {var_type_conf.type}"
- return binaryninja.types.Type.create(ref_handle, self._function.platform, var_type_conf.confidence)
+ return binaryninja.types.Type.create(var_type_conf.type, self._function.platform, var_type_conf.confidence)
return None
@type.setter