summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/librtld_db/rtld_db.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/librtld_db/rtld_db.c b/lib/librtld_db/rtld_db.c
index 5b41e544b3609..6e828d7d3d04a 100644
--- a/lib/librtld_db/rtld_db.c
+++ b/lib/librtld_db/rtld_db.c
@@ -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) {