Skip to content

Commit 1dc7128

Browse files
committed
Stackless issue python#198: Improve the soft-switchable extension functions
Fix a reference leak in the demo/test code.
1 parent 60f321a commit 1dc7128

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Stackless/module/_teststackless.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,14 @@ demo_soft_switchable(PyObject *retval, long *step, PyObject **ob1,
183183
* Therefore we may call STACKLESS_PROMOTE_ALL();
184184
*/
185185
PyObject * args = PyTuple_New(0);
186+
if (!args) {
187+
Py_CLEAR(retval);
188+
goto exit_func;
189+
}
186190
STACKLESS_PROMOTE_ALL();
187191
Py_SETREF(retval, PyObject_Call(retval, args, NULL));
188192
STACKLESS_ASSERT();
193+
Py_DECREF(args);
189194
if (STACKLESS_UNWINDING(retval))
190195
return retval;
191196
/* no break */

0 commit comments

Comments
 (0)