summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2019-03-27-22-35-16.bpo-36459.UAvkKp.rst1
-rw-r--r--Parser/tokenizer.c1
2 files changed, 1 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-03-27-22-35-16.bpo-36459.UAvkKp.rst b/Misc/NEWS.d/next/Core and Builtins/2019-03-27-22-35-16.bpo-36459.UAvkKp.rst
new file mode 100644
index 0000000..6c234a6
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2019-03-27-22-35-16.bpo-36459.UAvkKp.rst
@@ -0,0 +1 @@
+Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's ``tok_nextc()``.
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index ad05497..58dd1cd 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -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;