Skip to content

Commit

Permalink
fixed fstream memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
raicool committed Aug 17, 2023
1 parent 5cde031 commit 1dd75be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/file/spotpass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ uint8_t spotpass::load(const char* dir)
if (file_size != 0xCAFE4)
{
LOG_ERROR("load error : the given spotpass file was the incorrect size!");
spotpass_data.close();
return -1;
}

Expand Down Expand Up @@ -143,6 +144,7 @@ bool spotpass::add_ghost(const char* ghost_dir)
if (offset >= next_course_ghost_offset)
{
LOG_ERROR("ghost add error : there is no more room for a new ghost in this course, please delete ghosts to make space!");
ghost_data.close();
return false;
}

Expand Down

0 comments on commit 1dd75be

Please sign in to comment.