]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-140067: Fix memory leak in sub-interpreter creation (#140111) (#140261)
authorKumar Aditya <kumaraditya@python.org>
Sat, 18 Oct 2025 11:06:58 +0000 (16:36 +0530)
committerGitHub <noreply@github.com>
Sat, 18 Oct 2025 11:06:58 +0000 (16:36 +0530)
commit58c44c2bf2e6d251548652a21d9ee27265ee6dea
tree96885a26245507df14b501ba3f967c5d5dde52b3
parentc8729c9909e150989050ce2a435d018955bea41d
gh-140067: Fix memory leak in sub-interpreter creation (#140111)  (#140261)

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.

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