Fixed a memory leak in the parser caused by for loops