Skip to content

Commit cda139d

Browse files
ZackerySpytzserhiy-storchaka
authored andcommitted
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.
1 parent 796cc6e commit cda139d

2 files changed

Lines changed: 1 addition & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's ``tok_nextc()``.

Parser/tokenizer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,6 @@ tok_nextc(struct tok_state *tok)
963963
newbuf = (char *)PyMem_REALLOC(newbuf,
964964
newsize);
965965
if (newbuf == NULL) {
966-
PyMem_FREE(tok->buf);
967966
tok->done = E_NOMEM;
968967
tok->cur = tok->inp;
969968
return EOF;

0 commit comments

Comments
 (0)