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 | 10161091f7607ff99674305e50311ca8f79e47f7 (patch) | |
tree | a004a1265ceecfe47bf4c75ab9708f8e56d75688 /bfd/coffgen.c | |
parent | 129edb4713db7599810b1092fc7ae989da8e8b63 (diff) | |
download | binutils-redhat-10161091f7607ff99674305e50311ca8f79e47f7.tar.gz |
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 e5fb6454d3..0ecc6023e6 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; |