]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (#140303)
authorShamil <ashm.tech@proton.me>
Mon, 20 Oct 2025 09:29:23 +0000 (12:29 +0300)
committerGitHub <noreply@github.com>
Mon, 20 Oct 2025 09:29:23 +0000 (09:29 +0000)
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 af7828d6a030ab953a4ca92539556c2af81c8278..955457cdcf5c289c0651f5939b2f28630a9fb225 100644 (file)
@@ -963,6 +963,8 @@ PyInterpreterState_Delete(PyInterpreterState *interp)
 
     _PyObject_FiniState(interp);
 
+    PyConfig_Clear(&interp->config);
+
     free_interpreter(interp);
 }