about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/jitter/Jittcc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/miasm2/jitter/Jittcc.c b/miasm2/jitter/Jittcc.c
index a2102609..a162c41b 100644
--- a/miasm2/jitter/Jittcc.c
+++ b/miasm2/jitter/Jittcc.c
@@ -141,6 +141,9 @@ PyObject* tcc_exec_bloc(PyObject* self, PyObject* args)
 	if (!PyArg_ParseTuple(args, "OOOO", &retaddr, &jitcpu, &lbl2ptr, &breakpoints))
 		return NULL;
 
+	/* The loop will decref retaddr always once */
+	Py_INCREF(retaddr);
+
 	for (;;) {
 		// Init
 		BlockDst.is_local = 0;
@@ -161,6 +164,7 @@ PyObject* tcc_exec_bloc(PyObject* self, PyObject* args)
 
 		// Execute it
 		status = func(&BlockDst, jitcpu);
+		Py_DECREF(retaddr);
 		retaddr = PyLong_FromUnsignedLongLong(BlockDst.address);
 
 		// Check exception