]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (GH-140303...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 20 Oct 2025 09:54:41 +0000 (11:54 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Oct 2025 09:54:41 +0000 (09:54 +0000)
gh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (GH-140303)
(cherry picked from commit a615fb49c948902a982c3256899507abcc9f9bc8)

Co-authored-by: Shamil <ashm.tech@proton.me>
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 7f365ea50cab7d0a3e694291545214d7f3258a46..06f997fb5ad5becef878fa9a3faedd7ddd25b1fe 100644 (file)
@@ -1049,6 +1049,8 @@ PyInterpreterState_Delete(PyInterpreterState *interp)
 
     _PyObject_FiniState(interp);
 
+    PyConfig_Clear(&interp->config);
+
     free_interpreter(interp);
 }