fix: don\'t fclose NULL pointer