Skip to content

Commit 367ea89

Browse files
[3.13] Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-128006)
Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-127910) After commit 10a91d7 introduced arena cleanup, commit 2dfbd4f removed the free call when _PyCompile_AstOptimize fails. (cherry picked from commit cfeaa99) Co-authored-by: Berker Peksag <[email protected]>
1 parent 71a1e79 commit 367ea89

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/pythonrun.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,7 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start,
14851485
if (flags && (flags->cf_flags & PyCF_ONLY_AST)) {
14861486
if ((flags->cf_flags & PyCF_OPTIMIZED_AST) == PyCF_OPTIMIZED_AST) {
14871487
if (_PyCompile_AstOptimize(mod, filename, flags, optimize, arena) < 0) {
1488+
_PyArena_Free(arena);
14881489
return NULL;
14891490
}
14901491
}

0 commit comments

Comments
 (0)