bpo-34080: Fix a memory leak in the compiler. (GH-8222) (GH-8257) · python/cpython@3b06285

File tree

2 files changed

lines changed

  • Misc/NEWS.d/next/Core and Builtins

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,2 @@

1+

Fixed a memory leak in the compiler when it raised some uncommon errors

2+

during tokenizing.

Original file line numberDiff line numberDiff line change

@@ -1328,7 +1328,7 @@ err_input(perrdetail *err)

13281328

errtype = PyExc_SyntaxError;

13291329

switch (err->error) {

13301330

case E_ERROR:

1331-

return;

1331+

goto cleanup;

13321332

case E_SYNTAX:

13331333

errtype = PyExc_IndentationError;

13341334

if (err->expected == INDENT)