From 22ed7fe9064d3ba21abcb76fab78cf587783039b Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 29 Jun 2013 21:03:51 +0200 Subject: [PATCH] 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. --- Parser/pgenmain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c index 52b8380c33f..a624dd2c61a 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);