Fix leak in error condition