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

Skip to content

Commit 95e2cc5

Browse files
committed
Fix refcount.
1 parent 5944e25 commit 95e2cc5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Modules/_collectionsmodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,14 @@ static PyObject *
616616
deque_repeat(dequeobject *deque, Py_ssize_t n)
617617
{
618618
dequeobject *new_deque;
619+
PyObject *rv;
619620

620621
new_deque = (dequeobject *)deque_copy((PyObject *) deque);
621622
if (new_deque == NULL)
622623
return NULL;
623-
return deque_inplace_repeat(new_deque, n);
624+
rv = deque_inplace_repeat(new_deque, n);
625+
Py_DECREF(new_deque);
626+
return rv;
624627
}
625628

626629
/* The rotate() method is part of the public API and is used internally

0 commit comments

Comments
 (0)