summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-02-13 00:45:53 +0000
committerGitHub <noreply@github.com>2019-02-13 00:45:53 +0000
commitb9d2e97601847a1845bf96e2895a6214f02b92a6 (patch)
tree1bb2cc61cd2877e607bd8f88765fd61f1f54bdbc /Parser
parent3dc67d0316740e78e7cd014343f34d85908219b7 (diff)
downloadcpython-git-b9d2e97601847a1845bf96e2895a6214f02b92a6.tar.gz
Fix potential memory leak in parsetok.c (GH-11832)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/parsetok.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 1fa4a1286b..6a96f6bc5a 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -370,7 +370,6 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
type_ignores.items[i], 0);
}
}
- growable_int_array_deallocate(&type_ignores);
#ifndef PGEN
/* Check that the source for a single input statement really
@@ -405,6 +404,8 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
else
n = NULL;
+ growable_int_array_deallocate(&type_ignores);
+
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
*flags = ps->p_flags;
#endif