]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-153252: Fix error handling in `_PyCompile_CodeGen` (GH-153253) (#153281)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Jul 2026 17:27:32 +0000 (19:27 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Jul 2026 17:27:32 +0000 (20:27 +0300)
gh-153252: Fix error handling in `_PyCompile_CodeGen` (GH-153253)
(cherry picked from commit a74280e6696125acb7628facc577d0f975c4d69e)

Co-authored-by: sobolevn <mail@sobolevn.me>
Python/compile.c

index f2c1de5e0c07c6378facd2982efa49ac77d97be3..fefb2b04b78db8674347e436e541ccbf90c9dc76 100644 (file)
@@ -1689,7 +1689,7 @@ _PyCompile_CodeGen(PyObject *ast, PyObject *filename, PyCompilerFlags *pflags,
 
     metadata = PyDict_New();
     if (metadata == NULL) {
-        return NULL;
+        goto finally;
     }
 
     if (compiler_codegen(c, mod) < 0) {