aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-06-08 19:58:45 +0930
committerAlan Modra <amodra@gmail.com>2023-06-09 12:56:12 +0930
commitca5321d49ae1b6d1ec91d4ff79e85dc8ec30576a (patch)
tree9d256755cc513a118efca82a29266627b1886a9e /binutils
parentce3ab55fa72dd8778f5fd5fea7d6389af16d141e (diff)
downloadgdb-ca5321d49ae1b6d1ec91d4ff79e85dc8ec30576a.zip
gdb-ca5321d49ae1b6d1ec91d4ff79e85dc8ec30576a.tar.gz
gdb-ca5321d49ae1b6d1ec91d4ff79e85dc8ec30576a.tar.bz2
readelf/objdump remember_state memory leaks
* dwarf.c (display_debug_frames <DW_CFA_restore_state>): Do free invalid remember_state.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/dwarf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 8a20bf2..4f695bf 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -9823,12 +9823,14 @@ display_debug_frames (struct dwarf_section *section,
{
warn (_("Invalid column number in saved frame state\n"));
fc->ncols = 0;
- break;
}
- memcpy (fc->col_type, rs->col_type,
- rs->ncols * sizeof (*rs->col_type));
- memcpy (fc->col_offset, rs->col_offset,
- rs->ncols * sizeof (*rs->col_offset));
+ else
+ {
+ memcpy (fc->col_type, rs->col_type,
+ rs->ncols * sizeof (*rs->col_type));
+ memcpy (fc->col_offset, rs->col_offset,
+ rs->ncols * sizeof (*rs->col_offset));
+ }
free (rs->col_type);
free (rs->col_offset);
free (rs);