fix memory leaks when parsing pipeline string