Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FreeToFull leaves the list empty
  • Loading branch information
iritkatriel committed Jan 31, 2023
commit fe65f492a1269f3341a23ef7d6862b6f634d0565
5 changes: 2 additions & 3 deletions Objects/obmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,8 @@ void
_PyFreeList_FreeToFull(_PyFreeList *list, void *ptr)
{
assert(list->space == 0);
PyObject_Free(ptr);
if (list->ptr == NULL) {
PyObject_Free(ptr);
return;
}
int space = 0;
Expand All @@ -776,8 +776,7 @@ _PyFreeList_FreeToFull(_PyFreeList *list, void *ptr)
space++;
}
list->ptr = ptr;
*((void **)ptr) = NULL;
list->space = space-1;
list->space = space;
}
#endif /* WITH_FREELISTS */

Expand Down