From ecf2b124a22590ac47688a6e8c2ff8865d23f774 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 30 Jan 2007 16:19:09 +0000 Subject: [PATCH] merge of 'c249e2584bf9a7142285afa71425029b4278e771' and 'f6e8ba00784e83d73dc2183c444f6595474796e4' --- libelf/ChangeLog | 4 ++++ libelf/nlist.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/libelf/ChangeLog b/libelf/ChangeLog index f3cf689..8d1f289 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,7 @@ +2007-01-30 Ulrich Drepper + + * nlist.c: Close file descriptor before returning. + 2006-10-13 Roland McGrath * elf32_updatenull.c: Look for and accept phdr also for ET_CORE. diff --git a/libelf/nlist.c b/libelf/nlist.c index fd2209d..b3a6af0 100644 --- a/libelf/nlist.c +++ b/libelf/nlist.c @@ -230,6 +230,9 @@ nlist (const char *filename, struct nlist *nl) /* We do not need the ELF descriptor anymore. */ (void) INTUSE(elf_end) (elf); + /* Neither the file descriptor. */ + (void) close (fd); + return 0; fail_dealloc: @@ -239,6 +242,9 @@ nlist (const char *filename, struct nlist *nl) /* We do not need the ELF descriptor anymore. */ (void) INTUSE(elf_end) (elf); + /* Neither the file descriptor. */ + (void) close (fd); + fail: /* We have to set all entries to zero. */ while (nl->n_name != NULL && nl->n_name[0] != '\0') -- 2.7.4