Commit dffe90ee authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub

bpo-36459: Fix a possible double PyMem_FREE() due to tokenizer.c's tok_nextc() (12601)


Remove the PyMem_FREE() call added in cb90c89d.  The buffer will be
freed when PyTokenizer_Free() is called on the tokenizer state.
(cherry picked from commit cda139d1)
Co-authored-by: default avatarZackery Spytz <zspytz@gmail.com>
parent bb89aa24
Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's ``tok_nextc()``.
......@@ -979,7 +979,6 @@ tok_nextc(register 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment