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 index 00000000000000..d58837f39799fe --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst @@ -0,0 +1 @@ +Fix a possible reference leak in a corrupted ``TYPE_CODE`` marshal stream diff --git a/Python/marshal.c b/Python/marshal.c index b60a36e128cd9f..6a815fa01958e2 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1599,7 +1599,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;