Merge pull request #2235 from slark-yuxj/master

fix:Resource leak: fp
This commit is contained in:
Ha Thach 2023-09-12 17:43:14 +07:00 committed by GitHub
commit 46f7cf4da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,6 +172,7 @@ static struct elf_file *load_elf(const char *filename)
ef = (struct elf_file *)malloc(sizeof(*ef));
if (!ef)
{
fclose(fp);
return NULL;
}
@ -182,6 +183,7 @@ static struct elf_file *load_elf(const char *filename)
buf = (char *)malloc(fsize);
if (!buf)
{
fclose(fp);
return NULL;
}