summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/typeobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a190e7a..9d77a5d 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1442,8 +1442,10 @@ call_method(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
va_end(va);
- if (args == NULL)
+ if (args == NULL) {
+ Py_DECREF(func);
return NULL;
+ }
assert(PyTuple_Check(args));
retval = PyObject_Call(func, args, NULL);