Skip to content

Commit

Permalink
fix the Resource leak: fp
Browse files Browse the repository at this point in the history
fix the Resource leak: fp

Signed-off-by: zengwei [email protected]
  • Loading branch information
zengwei00 authored Dec 19, 2023
1 parent 1d19714 commit 99878af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wiiu/hbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,10 @@ int HBL_loadToMemory(const char *filepath, u32 args_size)
size_t buffer_size = (fileSize + 0x3f) & ~0x3f;
unsigned char *buffer = (unsigned char *) memalign(0x40, buffer_size);

if (!buffer)
return -1;
if (!buffer) {
fclose(fp);
return -1;
}

memset(buffer, 0, buffer_size);

Expand Down

0 comments on commit 99878af

Please sign in to comment.