Skip to content

Commit 7015ae6

Browse files
committed
fix reference leak in count_nextlong
1 parent 551a741 commit 7015ae6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/itertoolsmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,6 +3538,7 @@ count_nextlong(countobject *lz)
35383538
if (long_cnt == NULL) {
35393539
/* Switch to slow_mode */
35403540
long_cnt = PyLong_FromSsize_t(PY_SSIZE_T_MAX);
3541+
lz->long_cnt = long_cnt;
35413542
if (long_cnt == NULL)
35423543
return NULL;
35433544
}

0 commit comments

Comments
 (0)