Skip to content

Commit cfeaa99

Browse files
authored
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.
1 parent 3b76682 commit cfeaa99

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/pythonrun.c

+1
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,7 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start,
14861486
if (flags && (flags->cf_flags & PyCF_ONLY_AST)) {
14871487
if ((flags->cf_flags & PyCF_OPTIMIZED_AST) == PyCF_OPTIMIZED_AST) {
14881488
if (_PyCompile_AstOptimize(mod, filename, flags, optimize, arena) < 0) {
1489+
_PyArena_Free(arena);
14891490
return NULL;
14901491
}
14911492
}

0 commit comments

Comments
 (0)