Skip to content

Commit

Permalink
bpo-36459: Fix a possible double PyMem_FREE() due to tokenizer.c's to…
Browse files Browse the repository at this point in the history
…k_nextc() (12601)

Remove the PyMem_FREE() call added in cb90c89.  The buffer will be
freed when PyTokenizer_Free() is called on the tokenizer state.
(cherry picked from commit cda139d)

Co-authored-by: Zackery Spytz <[email protected]>
  • Loading branch information
miss-islington and ZackerySpytz authored Mar 28, 2019
1 parent bb89aa2 commit dffe90e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's ``tok_nextc()``.
1 change: 0 additions & 1 deletion Parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dffe90e

Please sign in to comment.