From: Christian Heimes Date: Sat, 29 Jun 2013 19:03:51 +0000 (+0200) Subject: Fix resource leak in parser, free node ptr X-Git-Tag: v3.4.0a1~363 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22ed7fe9064d3ba21abcb76fab78cf587783039b;p=python 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. --- 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);