fix memory leak on failures while loading geometry