Fix a memory leak in the recent patch to detect loops in ELF section
authorNick Clifton <nickc@redhat.com>
Thu, 30 Oct 2014 09:37:45 +0000 (09:37 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 30 Oct 2014 09:37:45 +0000 (09:37 +0000)
string indicies.

* elf.c (bfd_section_from_shdr): Fix heap use after free memory
leak.

bfd/ChangeLog
bfd/elf.c
ld/ChangeLog

index c4a85c6..bbcb345 100644 (file)
@@ -1,13 +1,22 @@
+2014-10-30  Nick Clifton  <nickc@redhat.com>
+
+       Appy trunk patch:
+
+       2014-10-29  Nick Clifton  <nickc@redhat.com>
+       * elf.c (bfd_section_from_shdr): Fix heap use after free memory
+       leak.
+
 2014-10-28  Matthew Fortune  <matthew.fortune@imgtec.com>
 
-       Apply trunk patches
+       Apply trunk patches:
+
        2014-10-22  Matthew Fortune  <matthew.fortune@imgtec.com>
        * elfxx-mips.c (print_mips_ases): Print unknown ASEs.
        (print_mips_isa_ext): Print the value of an unknown extension.
 
 2014-10-28  Nick Clifton  <nickc@redhat.com>
 
-       Apply trunk patches:
+       Apply trunk patches:
 
        2014-10-28  Nick Clifton  <nickc@redhat.com>
        PR binutils/17512
@@ -39,7 +48,8 @@
 
 2014-10-28  Alan Modra  <amodra@gmail.com>
 
-       Apply trunk patches
+       Apply trunk patches:
+
        2014-10-21  Alan Modra  <amodra@gmail.com>
        * elf64-ppc.c (ppc64_elf_tls_optimize): Ignore relocs against toc
        entries that aren't a multiple of 8 rather than failing assertion.
index b5fc84b..c8e659a 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2106,7 +2106,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
  fail:
   ret = FALSE;
  success:
-  if (sections_being_created)
+  if (sections_being_created && sections_being_created_abfd == abfd)
     sections_being_created [shindex] = FALSE;
   if (-- nesting == 0)
     {
index f063ef4..dc69837 100644 (file)
@@ -1,6 +1,7 @@
 2014-10-29  Nick Clifton  <nickc@redhat.com>
 
        * po/bg.po: Updated Bulgarian translation.
+
 2014-10-28  Alan Modra  <amodra@gmail.com>
 
        Apply trunk patches