Commit 6e2333df authored by Victor Stinner's avatar Victor Stinner

PyEval_CallObjectWithKeywords() doesn't inc/decref

Issue #27809: PyEval_CallObjectWithKeywords() doesn't increment temporary the
reference counter of the args tuple (positional arguments). The caller already
holds a strong reference to it.
parent 7e7823a0
...@@ -4580,8 +4580,6 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf) ...@@ -4580,8 +4580,6 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
PyObject * PyObject *
PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
{ {
PyObject *result;
#ifdef Py_DEBUG #ifdef Py_DEBUG
/* PyEval_CallObjectWithKeywords() must not be called with an exception /* PyEval_CallObjectWithKeywords() must not be called with an exception
set. It raises a new exception if parameters are invalid or if set. It raises a new exception if parameters are invalid or if
...@@ -4605,11 +4603,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) ...@@ -4605,11 +4603,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
return NULL; return NULL;
} }
Py_INCREF(args); return PyObject_Call(func, args, kwargs);
result = PyObject_Call(func, args, kwargs);
Py_DECREF(args);
return result;
} }
const char * const char *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment