]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34080: Fix a memory leak in the compiler. (GH-8222)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 Jul 2018 21:54:29 +0000 (14:54 -0700)
committerGitHub <noreply@github.com>
Wed, 11 Jul 2018 21:54:29 +0000 (14:54 -0700)
(cherry picked from commit 993030aac576710a46b3dd0b4864f819d4a94145)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Misc/NEWS.d/next/Core and Builtins/2018-07-10-11-24-16.bpo-34080.8t7PtO.rst [new file with mode: 0644]
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 (file)
index 0000000..cfc53cc
--- /dev/null
@@ -0,0 +1,2 @@
+Fixed a memory leak in the compiler when it raised some uncommon errors
+during tokenizing.
index 64b874ee11549a73e30c7816a7cbc9249479f9cb..9b9d63ccd8e44a7843274a6d4ff9b42143b640c5 100644 (file)
@@ -1339,7 +1339,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)