fix memory leak on error (from Coverity scan)