aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-sframe.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2025-01-04 13:39:20 +1030
committerAlan Modra <amodra@gmail.com>2025-01-04 19:15:56 +1030
commit003ced705f6d4c10b7f0fb96acf7ec2db58f902e (patch)
treeaf8b13a906b8bdb588e211fe6ff303f049f87c1d /bfd/elf-sframe.c
parentc232d080c4f05b16e998bd49d6e2d92c56b6421e (diff)
downloadgdb-003ced705f6d4c10b7f0fb96acf7ec2db58f902e.zip
gdb-003ced705f6d4c10b7f0fb96acf7ec2db58f902e.tar.gz
gdb-003ced705f6d4c10b7f0fb96acf7ec2db58f902e.tar.bz2
ELF sec_info memory leaks
Use the bfd's objalloc memory so we don't need to free anything attached to elf_section_data sec_info. Other uses of sec_info that need to allocate memory already use bfd_alloc. * elf-eh-frame.c (_bfd_elf_parse_eh_frame): bfd_alloc sec_info. * elf-sframe.c (_bfd_elf_parse_sframe): Likewise.
Diffstat (limited to 'bfd/elf-sframe.c')
-rw-r--r--bfd/elf-sframe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf-sframe.c b/bfd/elf-sframe.c
index 874d7c2..abc5c52 100644
--- a/bfd/elf-sframe.c
+++ b/bfd/elf-sframe.c
@@ -214,7 +214,7 @@ _bfd_elf_parse_sframe (bfd *abfd,
/* 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);