fix memory leaks when parse error-recovering/error-reporting