Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eec72a7

Browse files
Add missing Py_DECREF in fast_cfunction. Partial fix for SF bug
#127699.
1 parent 2a78cf2 commit eec72a7

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Python/ceval.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,9 +2769,12 @@ fast_cfunction(PyObject *func, PyObject ***pp_stack, int na)
27692769

27702770
if (na == 0)
27712771
return (*meth)(self, NULL);
2772-
else if (na == 1)
2773-
return (*meth)(self, EXT_POP(*pp_stack));
2774-
else {
2772+
else if (na == 1) {
2773+
PyObject *arg = EXT_POP(*pp_stack);
2774+
PyObject *result = (*meth)(self, arg);
2775+
Py_DECREF(arg);
2776+
return result;
2777+
} else {
27752778
PyObject *args = load_args(pp_stack, na);
27762779
PyObject *result = (*meth)(self, args);
27772780
Py_DECREF(args);

0 commit comments

Comments
 (0)