mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
bpo-36459: Fix a possible double PyMem_FREE() due to tokenizer.c's tok_nextc() (12601)
Remove the PyMem_FREE() call added in cb90c89. The buffer will be
freed when PyTokenizer_Free() is called on the tokenizer state.
This commit is contained in:
parent
796cc6e3ad
commit
cda139d1de
2 changed files with 1 additions and 1 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's ``tok_nextc()``.
|
||||||
|
|
@ -963,7 +963,6 @@ tok_nextc(struct tok_state *tok)
|
||||||
newbuf = (char *)PyMem_REALLOC(newbuf,
|
newbuf = (char *)PyMem_REALLOC(newbuf,
|
||||||
newsize);
|
newsize);
|
||||||
if (newbuf == NULL) {
|
if (newbuf == NULL) {
|
||||||
PyMem_FREE(tok->buf);
|
|
||||||
tok->done = E_NOMEM;
|
tok->done = E_NOMEM;
|
||||||
tok->cur = tok->inp;
|
tok->cur = tok->inp;
|
||||||
return EOF;
|
return EOF;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue