aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-08-30 11:10:58 +0930
committerAlan Modra <amodra@gmail.com>2023-08-30 11:22:23 +0930
commit02838630379cf76554a53be182bd9ad05a5a2a4d (patch)
tree8d1225a2dd66b92697021f76a4063d102a489250 /binutils
parenta422bb9db1a432f6094a186e243717512d50eec9 (diff)
downloadgdb-02838630379cf76554a53be182bd9ad05a5a2a4d.zip
gdb-02838630379cf76554a53be182bd9ad05a5a2a4d.tar.gz
gdb-02838630379cf76554a53be182bd9ad05a5a2a4d.tar.bz2
binutils/dwarf.c abbrev list leak
* dwarf.c (process_debug_info): Call free_abrev_list on return paths.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/dwarf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 80bbc54..9e22a74 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -3997,7 +3997,11 @@ process_debug_info (struct dwarf_section * section,
}
}
if (dwarf_start_die != 0 && level < saved_level)
- return true;
+ {
+ if (list != NULL)
+ free_abbrev_list (list);
+ return true;
+ }
continue;
}
@@ -4038,6 +4042,8 @@ process_debug_info (struct dwarf_section * section,
}
warn (_("DIE at offset %#lx refers to abbreviation number %lu which does not exist\n"),
die_offset, abbrev_number);
+ if (list != NULL)
+ free_abbrev_list (list);
return false;
}