fix parser memory leak bug