From 10161091f7607ff99674305e50311ca8f79e47f7 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Tue, 31 Jul 2007 03:53:24 +0000 Subject: 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/coffgen.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'bfd/coffgen.c') 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; -- cgit v1.2.1