diff options
author | Michael Snyder <msnyder@vmware.com> | 2007-07-31 03:53:24 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2007-07-31 03:53:24 +0000 |
commit | 9ee2139f60a79a6619a7ee96c00552ad038f6981 (patch) | |
tree | 6c4726dac59f8b127745db8d56652a7e012e9d7b /bfd/coffgen.c | |
parent | 615c7d515bfd80679d3b56997edfeb73eeefe433 (diff) | |
download | gdb-9ee2139f60a79a6619a7ee96c00552ad038f6981.zip gdb-9ee2139f60a79a6619a7ee96c00552ad038f6981.tar.gz gdb-9ee2139f60a79a6619a7ee96c00552ad038f6981.tar.bz2 |
2007-07-30 Michael Snyder <msnyder@access-company.com>
* coffgen.c (_bfd_coff_read_internal_relocs): Revert change of
2007-07-26. Buffer still in use, can't be freed.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r-- | bfd/coffgen.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c index e5fb645..0ecc602 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -460,22 +460,17 @@ _bfd_coff_read_internal_relocs (bfd *abfd, free_external = NULL; } - if (free_internal != NULL) + if (cache && free_internal != NULL) { - if (cache) - free (free_internal); - else + if (coff_section_data (abfd, sec) == NULL) { - if (coff_section_data (abfd, sec) == NULL) - { - amt = sizeof (struct coff_section_tdata); - sec->used_by_bfd = bfd_zalloc (abfd, amt); - if (sec->used_by_bfd == NULL) - goto error_return; - coff_section_data (abfd, sec)->contents = NULL; - } - coff_section_data (abfd, sec)->relocs = free_internal; + amt = sizeof (struct coff_section_tdata); + sec->used_by_bfd = bfd_zalloc (abfd, amt); + if (sec->used_by_bfd == NULL) + goto error_return; + coff_section_data (abfd, sec)->contents = NULL; } + coff_section_data (abfd, sec)->relocs = free_internal; } return internal_relocs; |