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.
This commit is contained in:
Christian Heimes 2013-06-29 21:03:51 +02:00
parent b91ffaa1d8
commit 22ed7fe906
1 changed files with 1 additions and 0 deletions

View File

@ -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);