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:
Zackery Spytz 2019-03-28 07:53:00 -06:00 committed by Serhiy Storchaka
parent 796cc6e3ad
commit cda139d1de
2 changed files with 1 additions and 1 deletions

View file

@ -0,0 +1 @@
Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's ``tok_nextc()``.

View file

@ -963,7 +963,6 @@ tok_nextc(struct tok_state *tok)
newbuf = (char *)PyMem_REALLOC(newbuf,
newsize);
if (newbuf == NULL) {
PyMem_FREE(tok->buf);
tok->done = E_NOMEM;
tok->cur = tok->inp;
return EOF;