Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
filesystem: fix memory leak when unable to read data
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Aug 20, 2024
1 parent f17ae2b commit 2f832a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ bool File_Load(const char *path, char **output_data, size_t *output_size)
if (File_Pos(fp) != data_size) {
LOG_ERROR("Can't read file %s", path);
Memory_FreePointer(&data);
File_Close(fp);
return false;
}
File_Close(fp);
Expand Down

0 comments on commit 2f832a2

Please sign in to comment.