]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-147998: Fix possible memory leak in _pop_preserved (crossinterp.c) (GH-147999)
authorMaurycy Pawłowski-Wieroński <maurycy@maurycy.com>
Mon, 4 May 2026 13:45:31 +0000 (15:45 +0200)
committerGitHub <noreply@github.com>
Mon, 4 May 2026 13:45:31 +0000 (16:45 +0300)
Misc/NEWS.d/next/Core_and_Builtins/2026-04-02-13-25-09.gh-issue-147998.wnzkRT.rst [new file with mode: 0644]
Python/crossinterp.c

diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-04-02-13-25-09.gh-issue-147998.wnzkRT.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-02-13-25-09.gh-issue-147998.wnzkRT.rst
new file mode 100644 (file)
index 0000000..e83d992
--- /dev/null
@@ -0,0 +1,3 @@
+Fixed a memory leak in interpreter helper calls so cleanup works when an
+operation falls across interpreter boundaries. Patch by Maurycy
+Pawłowski-Wieroński.
index 4cd4b32ef906bb3de95ab63b32e945537d654f32..6b489bf03f86ecdbbd70d1f5f3a37c7773452e0c 100644 (file)
@@ -3006,7 +3006,7 @@ _pop_preserved(_PyXI_session *session,
         *p_xidata = NULL;
     }
     else {
-        _PyXI_namespace *xidata = _create_sharedns(session->_preserved);
+        xidata = _create_sharedns(session->_preserved);
         if (xidata == NULL) {
             failure.code = _PyXI_ERR_PRESERVE_FAILURE;
             goto error;