REQUIRE (skip_bytes (&buf, end, hdr_length - 4));
}
- sec_info = (struct eh_frame_sec_info *)
- bfd_zmalloc (sizeof (struct eh_frame_sec_info)
- + (num_entries - 1) * sizeof (struct eh_cie_fde));
+ sec_info = bfd_zalloc (abfd,
+ (sizeof (struct eh_frame_sec_info)
+ + (num_entries - 1) * sizeof (struct eh_cie_fde)));
REQUIRE (sec_info);
/* We need to have a "struct cie" for each CIE in this section. */
(_("error in %pB(%pA); no .eh_frame_hdr table will be created"),
abfd, sec);
hdr_info->u.dwarf.table = false;
- free (sec_info);
success:
_bfd_elf_munmap_section_contents (sec, ehbuf);
free (local_cies);
/* Decode the buffer and keep decoded contents for later use.
Relocations are performed later, but are such that the section's
size is unaffected. */
- sfd_info = bfd_malloc (sizeof (struct sframe_dec_info));
+ sfd_info = bfd_alloc (abfd, sizeof (*sfd_info));
sf_size = sec->size;
sfd_info->sfd_ctx = sframe_decode ((const char*)sfbuf, sf_size, &decerr);