Skip to content

Commit

Permalink
Fixed leak in lexer allocation, thanks to [email protected]
Browse files Browse the repository at this point in the history
Issue #142
  • Loading branch information
zik.saleeba committed Feb 23, 2013
1 parent 9243ef3 commit c82aced
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c82aced

Please sign in to comment.