Skip to content

Commit

Permalink
fix potentially sketchy use of stale pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed Jul 1, 2020
1 parent 84d1ee0 commit f4639eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util.cpp
Expand Up @@ -122,12 +122,13 @@ ISO Base Media File; store the resulting FILE* in a global source_file
FILE *APar_OpenISOBaseMediaFile(const char *utf8file, bool open) {
if (open && !file_opened) {
source_file = APar_OpenFile(utf8file, "rb");
if (source_file != NULL) {
if (source_file != nullptr) {
file_opened = true;
}
} else {
} else if (file_opened) {
fclose(source_file);
file_opened = false;
source_file = nullptr;
}
return source_file;
}
Expand Down

0 comments on commit f4639eb

Please sign in to comment.