Kaydet (Commit) 25b87d35 authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) Victor Stinner

bpo-34190: Fix reference leak in call_function() (GH-8413) (GH-8418)

(cherry picked from commit 147d9551)
Co-authored-by: 's avatarjdemeyer <jdemeyer@cage.ugent.be>
üst 4e166ffd
......@@ -4565,12 +4565,15 @@ call_function(PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames)
profiling. */
PyObject *self = stack[0];
func = Py_TYPE(func)->tp_descr_get(func, self, (PyObject*)Py_TYPE(self));
if (func == NULL) {
return NULL;
if (func != NULL) {
C_TRACE(x, _PyCFunction_FastCallKeywords(func,
stack+1, nargs-1,
kwnames));
Py_DECREF(func);
}
else {
x = NULL;
}
C_TRACE(x, _PyCFunction_FastCallKeywords(func, stack+1, nargs-1,
kwnames));
Py_DECREF(func);
}
else {
x = _PyMethodDescr_FastCallKeywords(func, stack, nargs, kwnames);
......
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