From: Alan Modra Date: Thu, 8 Jun 2023 10:28:45 +0000 (+0930) Subject: readelf/objdump remember_state memory leaks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca5321d49ae1b6d1ec91d4ff79e85dc8ec30576a;p=binutils-gdb.git readelf/objdump remember_state memory leaks * dwarf.c (display_debug_frames ): Do free invalid remember_state. --- diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 8a20bf2a349..4f695bf2bca 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);