[3.8] bpo-40412: Nullify inittab_copy during finalization (GH-19746) by miss-islington · Pull Request #19841 · python/cpython
Otherwise we leave a dangling pointer to free'd memory. If we
then initialize a new interpreter in the same process and call
PyImport_ExtendInittab, we will (likely) crash when calling
PyMem_RawRealloc(inittab_copy, ...) since the pointer address
is bogus.
Automerge-Triggered-By: @brettcannon
(cherry picked from commit 64224a4)
Co-authored-by: Gregory Szorc gregory.szorc@gmail.com
https://bugs.python.org/issue40412
Automerge-Triggered-By: @brettcannon