summaryrefslogtreecommitdiff
path: root/Parser/pgenmain.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-06-29 21:03:51 +0200
committerChristian Heimes <christian@cheimes.de>2013-06-29 21:03:51 +0200
commit22ed7fe9064d3ba21abcb76fab78cf587783039b (patch)
treeef1c4d8c8a3e63e59083746a5b062c7a8206f00d /Parser/pgenmain.c
parentb91ffaa1d8a0b258ff603a956b19f6f2aeeefb47 (diff)
downloadcpython-git-22ed7fe9064d3ba21abcb76fab78cf587783039b.tar.gz
Fix resource leak in parser, free node ptr
CID 1028068 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable n going out of scope leaks the storage it points to.
Diffstat (limited to 'Parser/pgenmain.c')
-rw-r--r--Parser/pgenmain.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c
index 52b8380c33..a624dd2c61 100644
--- a/Parser/pgenmain.c
+++ b/Parser/pgenmain.c
@@ -113,6 +113,7 @@ getgrammar(char *filename)
Py_Exit(1);
}
g = pgen(n);
+ PyNode_Free(n);
if (g == NULL) {
printf("Bad grammar.\n");
Py_Exit(1);