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.
This commit is contained in:
Michael Snyder 2007-07-31 03:53:24 +00:00
parent 615c7d515b
commit 9ee2139f60
2 changed files with 13 additions and 13 deletions

View File

@ -1,3 +1,8 @@
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.
2007-07-27 Michael Snyder <msnyder@access-company.com> 2007-07-27 Michael Snyder <msnyder@access-company.com>
* cofflink.c (coff_link_add_symbols): Return if count is zero. * cofflink.c (coff_link_add_symbols): Return if count is zero.

View File

@ -460,22 +460,17 @@ _bfd_coff_read_internal_relocs (bfd *abfd,
free_external = NULL; free_external = NULL;
} }
if (free_internal != NULL) if (cache && free_internal != NULL)
{ {
if (cache) if (coff_section_data (abfd, sec) == NULL)
free (free_internal);
else
{ {
if (coff_section_data (abfd, sec) == NULL) amt = sizeof (struct coff_section_tdata);
{ sec->used_by_bfd = bfd_zalloc (abfd, amt);
amt = sizeof (struct coff_section_tdata); if (sec->used_by_bfd == NULL)
sec->used_by_bfd = bfd_zalloc (abfd, amt); goto error_return;
if (sec->used_by_bfd == NULL) coff_section_data (abfd, sec)->contents = NULL;
goto error_return;
coff_section_data (abfd, sec)->contents = NULL;
}
coff_section_data (abfd, sec)->relocs = free_internal;
} }
coff_section_data (abfd, sec)->relocs = free_internal;
} }
return internal_relocs; return internal_relocs;