aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-10-29 20:58:13 +0000
committerNick Clifton <nickc@redhat.com>2014-10-29 20:58:13 +0000
commite5b470e24ce448a56230137a37d3b17299593041 (patch)
treef0b7420fd5b229c7003fa61727985d60a503d577 /bfd/elf.c
parentf60325bea599bab4cb721c6e797bc6b908fa616c (diff)
downloadgdb-e5b470e24ce448a56230137a37d3b17299593041.zip
gdb-e5b470e24ce448a56230137a37d3b17299593041.tar.gz
gdb-e5b470e24ce448a56230137a37d3b17299593041.tar.bz2
Fixes another memory corruption bug introduced by patches for PR 17512.
* elf.c (bfd_section_from_shdr): Fix heap use after free memory leak.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index dbb6f27..9c4dcdf 100644
--- 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)
{