fix a missing assignment causing fclose to crash