Forgot to free memory in some fail branches.