gh-131719: add NULL pointer check to _PyMem_FreeDelayed (gh-131720)

This commit is contained in:
Tomasz Pytel 2025-03-25 10:49:18 -04:00 committed by GitHub
parent 44605aa93d
commit 0a91456ad1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -1215,7 +1215,9 @@ void
_PyMem_FreeDelayed(void *ptr)
{
assert(!((uintptr_t)ptr & 0x01));
free_delayed((uintptr_t)ptr);
if (ptr != NULL) {
free_delayed((uintptr_t)ptr);
}
}
#ifdef Py_GIL_DISABLED