Skip to content

Commit 5a4d8b8

Browse files
fix: reset list allocated to 0
1 parent 72eca2a commit 5a4d8b8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Objects/listobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,6 +3260,7 @@ _PyList_AsTupleAndClear(PyListObject *self)
32603260
Py_ssize_t size = Py_SIZE(self);
32613261
self->ob_item = NULL;
32623262
Py_SET_SIZE(self, 0);
3263+
self->allocated = 0;
32633264
ret = _PyTuple_FromArraySteal(items, size);
32643265
free_list_items(items, false);
32653266
Py_END_CRITICAL_SECTION();

0 commit comments

Comments
 (0)