[Python-checkins] bpo-34080: Fix a memory leak in the compiler. (GH-8222) (GH-8257)

Victor Stinner webhook-mailer at python.org
Wed Jul 11 18:05:33 EDT 2018


https://github.com/python/cpython/commit/3b06285d2b7963d9d06b60e85712d5ecc6540deb
commit: 3b06285d2b7963d9d06b60e85712d5ecc6540deb
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Victor Stinner <vstinner at redhat.com>
date: 2018-07-12T00:05:29+02:00
summary:

bpo-34080: Fix a memory leak in the compiler. (GH-8222) (GH-8257)

(cherry picked from commit 993030aac576710a46b3dd0b4864f819d4a94145)

Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>

files:
A Misc/NEWS.d/next/Core and Builtins/2018-07-10-11-24-16.bpo-34080.8t7PtO.rst
M Python/pythonrun.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-07-10-11-24-16.bpo-34080.8t7PtO.rst b/Misc/NEWS.d/next/Core and Builtins/2018-07-10-11-24-16.bpo-34080.8t7PtO.rst
new file mode 100644
index 000000000000..cfc53cca4879
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2018-07-10-11-24-16.bpo-34080.8t7PtO.rst	
@@ -0,0 +1,2 @@
+Fixed a memory leak in the compiler when it raised some uncommon errors
+during tokenizing.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 7db7052e35e7..f03ccc2792bc 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1328,7 +1328,7 @@ err_input(perrdetail *err)
     errtype = PyExc_SyntaxError;
     switch (err->error) {
     case E_ERROR:
-        return;
+        goto cleanup;
     case E_SYNTAX:
         errtype = PyExc_IndentationError;
         if (err->expected == INDENT)



More information about the Python-checkins mailing list