summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-04-06 21:25:22 +0930
committerAlan Modra <amodra@gmail.com>2023-04-06 21:27:54 +0930
commit11aa9f628e28c077c860480571c152e07e6a4938 (patch)
treeda29ad7e95365630b0ce19a650da32ae4ae3ae68 /binutils
parenta5f3ca48236a79b0cf78a82dee1cc0241a975eb7 (diff)
downloadbinutils-gdb-11aa9f628e28c077c860480571c152e07e6a4938.tar.gz
Re: objcopy write_debugging_info memory leaks
Oops, tried to free too much * wrstabs.c (write_stabs_in_sections_debugging_info): Don't free strings.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/wrstabs.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c
index b676374558b..234a96f98a3 100644
--- a/binutils/wrstabs.c
+++ b/binutils/wrstabs.c
@@ -464,7 +464,7 @@ write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle,
bfd_size_type *pstringsize)
{
struct stab_write_handle info;
- struct string_hash_entry *h, *hnext;
+ struct string_hash_entry *h;
bfd_byte *p;
bool ret;
@@ -535,11 +535,6 @@ write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle,
free (info.symbols);
ret = false;
out:
- for (h = info.strings; h != NULL; h = hnext)
- {
- hnext = h->next;
- free (h);
- }
while (info.type_stack != NULL)
{
struct stab_type_stack *s = info.type_stack;