]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream...
authorWulian233 <1055917385@qq.com>
Mon, 4 May 2026 13:42:02 +0000 (21:42 +0800)
committerGitHub <noreply@github.com>
Mon, 4 May 2026 13:42:02 +0000 (16:42 +0300)
Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst [new file with mode: 0644]
Python/marshal.c

diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst
new file mode 100644 (file)
index 0000000..793858b
--- /dev/null
@@ -0,0 +1 @@
+Fix a possible reference leak in a corrupted ``TYPE_CODE`` marshal stream.
index dace22da0d4a94d2e218b7de23d00730be024b01..990afefe0d3b41926e9a54f05b89dbb8b06800af 100644 (file)
@@ -1636,7 +1636,7 @@ r_object(RFILE *p)
                 goto code_error;
             firstlineno = (int)r_long(p);
             if (firstlineno == -1 && PyErr_Occurred())
-                break;
+                goto code_error;
             linetable = r_object(p);
             if (linetable == NULL)
                 goto code_error;