Avoid double-closing an fd if elf_begin() fails.
Reported by: Miles Ohlrich <miles.ohlrich@isilon.com> MFC after: 1 week Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
78b83a1ea1
commit
48da4e2024
@ -275,10 +275,8 @@ rtld_syms(rd_agent_t *rdap, const char *rtldpath, u_long base)
|
||||
if (elf_version(EV_CURRENT) == EV_NONE)
|
||||
goto err;
|
||||
e = elf_begin(fd, ELF_C_READ, NULL);
|
||||
if (e == NULL) {
|
||||
close(fd);
|
||||
if (e == NULL)
|
||||
goto err;
|
||||
}
|
||||
|
||||
scn = NULL;
|
||||
while ((scn = elf_nextscn(e, scn)) != NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user