Fix file creation leak
Correct fix for character_create_from_template