]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-140301: Fix memory leak in subinterpreter PyConfig cleanup (GH-140303)...
authorShamil <ashm.tech@proton.me>
Mon, 27 Oct 2025 19:42:13 +0000 (22:42 +0300)
committerGitHub <noreply@github.com>
Mon, 27 Oct 2025 19:42:13 +0000 (19:42 +0000)
[3.13] gh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (GH-140303)
(cherry picked from commit a615fb49c948902a982c3256899507abcc9f9bc8)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Misc/NEWS.d/next/Core and Builtins/2025-10-18-18-08-36.gh-issue-140301.m-2HxC.rst [new file with mode: 0644]
Python/pystate.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2025-10-18-18-08-36.gh-issue-140301.m-2HxC.rst b/Misc/NEWS.d/next/Core and Builtins/2025-10-18-18-08-36.gh-issue-140301.m-2HxC.rst
new file mode 100644 (file)
index 0000000..8b1c81c
--- /dev/null
@@ -0,0 +1 @@
+Fix memory leak of ``PyConfig`` in subinterpreters.
index 68207443532cd09676142b715a4ffbd049658916..ba62a93d4574e6051069e2e7222537c510ed9590 100644 (file)
@@ -985,6 +985,8 @@ PyInterpreterState_Delete(PyInterpreterState *interp)
 
     _PyObject_FiniState(interp);
 
+    PyConfig_Clear(&interp->config);
+
     free_interpreter(interp);
 }