prevent FILE leak in case of a certain error