Small resource leak on error handling