summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorCharles G. Waldman <cgw@alum.mit.edu>2001-01-10 22:11:59 (GMT)
committerCharles G. Waldman <cgw@alum.mit.edu>2001-01-10 22:11:59 (GMT)
commiteec72a7fd9721b33971fddbc6c05c1e5551f794c (patch)
tree87a7bc4a11eb2d300693610b19a5d078e380f982 /Python
parent2a78cf2288b17279f3c244bf9040e16a9e1fb330 (diff)
downloadcpython-eec72a7fd9721b33971fddbc6c05c1e5551f794c.zip
cpython-eec72a7fd9721b33971fddbc6c05c1e5551f794c.tar.gz
cpython-eec72a7fd9721b33971fddbc6c05c1e5551f794c.tar.bz2
Add missing Py_DECREF in fast_cfunction. Partial fix for SF bug
#127699.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 1559456..5110746 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2769,9 +2769,12 @@ fast_cfunction(PyObject *func, PyObject ***pp_stack, int na)
if (na == 0)
return (*meth)(self, NULL);
- else if (na == 1)
- return (*meth)(self, EXT_POP(*pp_stack));
- else {
+ else if (na == 1) {
+ PyObject *arg = EXT_POP(*pp_stack);
+ PyObject *result = (*meth)(self, arg);
+ Py_DECREF(arg);
+ return result;
+ } else {
PyObject *args = load_args(pp_stack, na);
PyObject *result = (*meth)(self, args);
Py_DECREF(args);