summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-09-13 06:41:18 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-09-13 06:41:18 (GMT)
commit95e2cc5d122c8469c3fd3040f43311547a561663 (patch)
treedb50da1eca760b050bd33cc67f856989123d8da1
parent5944e251df1675ea2eb08857df291def298717d4 (diff)
downloadcpython-95e2cc5d122c8469c3fd3040f43311547a561663.zip
cpython-95e2cc5d122c8469c3fd3040f43311547a561663.tar.gz
cpython-95e2cc5d122c8469c3fd3040f43311547a561663.tar.bz2
Fix refcount.
-rw-r--r--Modules/_collectionsmodule.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 7f81460..17233e4 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -616,11 +616,14 @@ static PyObject *
deque_repeat(dequeobject *deque, Py_ssize_t n)
{
dequeobject *new_deque;
+ PyObject *rv;
new_deque = (dequeobject *)deque_copy((PyObject *) deque);
if (new_deque == NULL)
return NULL;
- return deque_inplace_repeat(new_deque, n);
+ rv = deque_inplace_repeat(new_deque, n);
+ Py_DECREF(new_deque);
+ return rv;
}
/* The rotate() method is part of the public API and is used internally