]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-147998: Fix possible memory leak in _pop_preserved (crossinterp.c) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 4 May 2026 14:11:04 +0000 (16:11 +0200)
committerGitHub <noreply@github.com>
Mon, 4 May 2026 14:11:04 +0000 (14:11 +0000)
(cherry picked from commit 72f29dc704812aa846b10323a31743d6df37cc2c)

Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
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 3b6c0c6e1eda4b8c6b0ee05f59f3e98b909d0a8f..ba31f356d511f0eaca7c4f859140cacd5a55537d 100644 (file)
@@ -2965,7 +2965,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;