]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-140067: Fix memory leak in sub-interpreter creation (GH-140111) (#140118)
authorKumar Aditya <kumaraditya@python.org>
Sat, 18 Oct 2025 14:10:43 +0000 (19:40 +0530)
committerGitHub <noreply@github.com>
Sat, 18 Oct 2025 14:10:43 +0000 (19:40 +0530)
commit1d11627ba555a365c820e1e1535a42a4f4fbd4c6
treef4f7c6397cc9c1482ed58db13ea3dfc47c6ecdd2
parent3ca7ea1f8fd593296106346b4dea06f126638aba
[3.14] gh-140067: Fix memory leak in sub-interpreter creation  (GH-140111) (#140118)

* [3.14] gh-140067: Fix memory leak in sub-interpreter creation  (GH-140111)

Fix memory leak in sub-interpreter creation caused by overwriting of the previously used `_malloced` field. Now the pointer is stored in the first word of the memory block to avoid it being overwritten accidentally.
(cherry picked from commit 59547a251f7069dc6e08cb6082dd21872671e381)

Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Include/internal/pycore_interp_structs.h
Lib/test/test_threading.py
Misc/NEWS.d/next/Core_and_Builtins/2025-10-14-17-07-37.gh-issue-140067.ID2gOm.rst [new file with mode: 0644]
Python/pystate.c