From: Maurycy Pawłowski-Wieroński Date: Mon, 4 May 2026 13:45:31 +0000 (+0200) Subject: gh-147998: Fix possible memory leak in _pop_preserved (crossinterp.c) (GH-147999) X-Git-Tag: v3.15.0b1~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72f29dc704812aa846b10323a31743d6df37cc2c;p=thirdparty%2FPython%2Fcpython.git gh-147998: Fix possible memory leak in _pop_preserved (crossinterp.c) (GH-147999) --- 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 index 000000000000..e83d9929eae5 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-02-13-25-09.gh-issue-147998.wnzkRT.rst @@ -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. diff --git a/Python/crossinterp.c b/Python/crossinterp.c index 4cd4b32ef906..6b489bf03f86 100644 --- a/Python/crossinterp.c +++ b/Python/crossinterp.c @@ -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;