From c82aced22d5fc5d11b248927847f31971195260c Mon Sep 17 00:00:00 2001 From: "zik.saleeba" Date: Sat, 23 Feb 2013 22:56:18 +0000 Subject: [PATCH] Fixed leak in lexer allocation, thanks to mmass@gmail.com Issue #142 --- lex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lex.c b/lex.c index b4ffa08..1daeef5 100644 --- a/lex.c +++ b/lex.c @@ -107,7 +107,12 @@ void LexInit(Picoc *pc) /* deallocate */ void LexCleanup(Picoc *pc) { + int Count; + 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 */