]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix file descriptor leak in nlist.
authorUlrich Drepper <drepper@redhat.com>
Tue, 30 Jan 2007 16:18:13 +0000 (16:18 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 30 Jan 2007 16:18:13 +0000 (16:18 +0000)
libelf/ChangeLog
libelf/nlist.c

index f3cf689723eeccdfeec5dfccfd66c7732bf8fa07..8d1f289d1a9888ab7d88eda6f683d06211e38bf7 100644 (file)
@@ -1,3 +1,7 @@
+2007-01-30  Ulrich Drepper  <drepper@redhat.com>
+
+       * nlist.c: Close file descriptor before returning.
+
 2006-10-13  Roland McGrath  <roland@redhat.com>
 
        * elf32_updatenull.c: Look for and accept phdr also for ET_CORE.
index fd2209dfa985d1ce322823395da10b28cea1580f..b3a6af0d68e1334ce23be895f1212a20f38d6cfa 100644 (file)
@@ -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')