From 9ee2139f60a79a6619a7ee96c00552ad038f6981 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Tue, 31 Jul 2007 03:53:24 +0000 Subject: [PATCH] 2007-07-30 Michael Snyder * coffgen.c (_bfd_coff_read_internal_relocs): Revert change of 2007-07-26. Buffer still in use, can't be freed. --- bfd/ChangeLog | 5 +++++ bfd/coffgen.c | 21 ++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4f519a3..867bc31 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2007-07-30 Michael Snyder + + * coffgen.c (_bfd_coff_read_internal_relocs): Revert change of + 2007-07-26. Buffer still in use, can't be freed. + 2007-07-27 Michael Snyder * cofflink.c (coff_link_add_symbols): Return if count is zero. 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; -- 2.7.4