mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Finally plug the memory leak caused by syntax error (including
interactive EOF, which leaked *one* byte).
This commit is contained in:
parent
6fc06e770f
commit
ff0ec52d3c
1 changed files with 4 additions and 1 deletions
|
@ -154,8 +154,11 @@ parsetok(tok, g, start, err_ret)
|
|||
str[len] = '\0';
|
||||
if ((err_ret->error =
|
||||
PyParser_AddToken(ps, (int)type, str,
|
||||
tok->lineno)) != E_OK)
|
||||
tok->lineno)) != E_OK) {
|
||||
if (err_ret->error != E_DONE)
|
||||
PyMem_DEL(str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (err_ret->error == E_DONE) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue