[Python-checkins] bpo-39307: Fix memory leak on error path in parsetok (GH-17953)

Pablo Galindo webhook-mailer at python.org
Mon Jan 13 05:35:52 EST 2020


https://github.com/python/cpython/commit/7ba6f18de2582755ae31888ba6a4237d96dddc48
commit: 7ba6f18de2582755ae31888ba6a4237d96dddc48
branch: master
author: Alex Henrie <alexhenrie24 at gmail.com>
committer: Pablo Galindo <Pablogsal at gmail.com>
date: 2020-01-13T10:35:47Z
summary:

bpo-39307: Fix memory leak on error path in parsetok (GH-17953)

files:
M Parser/parsetok.c

diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index a5d78974b871b..2bb733d0dcd66 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -246,6 +246,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
 
     if ((ps = PyParser_New(g, start)) == NULL) {
         err_ret->error = E_NOMEM;
+        growable_comment_array_deallocate(&type_ignores);
         PyTokenizer_Free(tok);
         return NULL;
     }



More information about the Python-checkins mailing list