Fixed leak in lexer allocation, thanks to mmass@gmail.com

Issue #142


git-svn-id: http://picoc.googlecode.com/svn/trunk@585 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2013-02-23 22:56:18 +00:00
parent a8891aa743
commit 62fc9d4f9f

5
lex.c
View file

@ -107,7 +107,12 @@ void LexInit(Picoc *pc)
/* deallocate */ /* deallocate */
void LexCleanup(Picoc *pc) void LexCleanup(Picoc *pc)
{ {
int Count;
LexInteractiveClear(pc, NULL); LexInteractiveClear(pc, NULL);
for (Count = 0; Count < sizeof(ReservedWords) / sizeof(struct ReservedWord); Count++)
TableDelete(pc, &pc->ReservedWordTable, TableStrRegister(pc, ReservedWords[Count].Word));
} }
/* check if a word is a reserved word - used while scanning */ /* check if a word is a reserved word - used while scanning */