Bug report
Code:
|
compiler *c = new_compiler(mod, filename, pflags, optimize, arena, NULL); |
|
if (c == NULL) { |
|
_PyArena_Free(arena); |
|
return NULL; |
|
} |
|
c->c_save_nested_seqs = true; |
|
|
|
metadata = PyDict_New(); |
|
if (metadata == NULL) { |
|
return NULL; |
|
} |
|
|
|
if (compiler_codegen(c, mod) < 0) { |
|
goto finally; |
|
} |
The problematic part is:
|
metadata = PyDict_New(); |
|
if (metadata == NULL) { |
|
return NULL; |
|
} |
It just returns NULL: does not free the compiler on error, does not free the arena, etc. It should be goto finally.
I have a PR ready.
Linked PRs
Bug report
Code:
cpython/Python/compile.c
Lines 1683 to 1697 in 12ed8b1
The problematic part is:
cpython/Python/compile.c
Lines 1690 to 1693 in 12ed8b1
It just returns
NULL: does not free the compiler on error, does not free the arena, etc. It should begoto finally.I have a PR ready.
Linked PRs
_PyCompile_CodeGen#153253