Skip to content

Commit

Permalink
Merge pull request #23 from milabs/fix-double-close
Browse files Browse the repository at this point in the history
Fix possible double-close issue (elf)
  • Loading branch information
kubo authored Nov 14, 2019
2 parents a1bbcea + 4e4c5f9 commit 0215d7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plthook_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ static int get_memory_permission(void *address)
}
if (start <= addr && addr < end) {
int prot = 0;
fclose(fp);
if (perms[0] == 'r') {
prot |= PROT_READ;
} else if (perms[0] != '-') {
Expand All @@ -419,6 +418,7 @@ static int get_memory_permission(void *address)
perms[4] = '\0';
goto unknown_perms;
}
fclose(fp);
return prot;
}
}
Expand Down

0 comments on commit 0215d7a

Please sign in to comment.