+2020-05-18 Alan Modra <amodra@gmail.com>
+
+ * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
+ they can be freed without also freeing internal_relocs.
+
2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
PR 25713
amt = external_reloc_size * section->reloc_count;
if (bfd_seek (abfd, section->rel_filepos, SEEK_SET) != 0)
return FALSE;
- external_relocs = _bfd_alloc_and_read (abfd, amt, amt);
+ external_relocs = _bfd_malloc_and_read (abfd, amt, amt);
if (external_relocs == NULL)
return FALSE;
internal_relocs = (arelent *) bfd_alloc (abfd, amt);
if (internal_relocs == NULL)
{
- bfd_release (abfd, external_relocs);
+ free (external_relocs);
return FALSE;
}
(*backend->adjust_reloc_in) (abfd, &intern, rptr);
}
- bfd_release (abfd, external_relocs);
+ free (external_relocs);
section->relocation = internal_relocs;