Fixes another memory corruption bug introduced by patches for PR 17512.
authorNick Clifton <nickc@redhat.com>
Wed, 29 Oct 2014 20:58:13 +0000 (20:58 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 29 Oct 2014 20:58:13 +0000 (20:58 +0000)
* elf.c (bfd_section_from_shdr): Fix heap use after free memory
leak.

bfd/ChangeLog
bfd/elf.c

index eebe6bd726abaaf028cc2666a5f50cfb15d78a24..a5790a568105df4f37756a4debf2b45d3ccebb0c 100644 (file)
@@ -1,6 +1,11 @@
+2014-10-29  Nick Clifton  <nickc@redhat.com>
+
+       * elf.c (bfd_section_from_shdr): Fix heap use after free memory
+       leak.
+
 2014-10-29  Dennis Brueni  <dbrueni@slickedit.com>
 
-       * elf.c (elfcore_write_lwpstatus): fix typo in call to memcpy
+       * elf.c (elfcore_write_lwpstatus): Fix typo in call to memcpy.
 
 2014-10-28  Nick Clifton  <nickc@redhat.com>
 
index dbb6f2758a52c252f7e8fc2278ae605f411be346..9c4dcdf452d1ab43c89d38b082214d0f694d3894 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)
     {