]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas dw2gencfi memory leaks
authorAlan Modra <amodra@gmail.com>
Wed, 1 Jan 2025 12:17:16 +0000 (22:47 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 1 Jan 2025 12:17:16 +0000 (22:47 +1030)
commit597de453a2291a798024471a3d7c5c0b79201f94
tree684b0382dfda5120c048e9d168b78bbe8b702ebd
parentb492153908463bd351eaa2cf3802117ce9e7c479
gas dw2gencfi memory leaks

Some of these could have remained as malloc'd memory, but that would
require quite a bit of code to traverse frch_cfi_data for example, and
would rely on matching cfi directives (ie. valid input).  Just put
them on the notes obstack instead.

* dw2gencfi.c (alloc_fde_entry): Use notes_calloc.
(alloc_cfi_insn_data): Likewise.
(cfi_end_fde): Don't free frch_cfi_data.
(cfi_add_label): Use notes_strdup.
(cfi_add_CFA_remember_state): Use notes_alloc.
(cfi_add_CFA_restore_state): Don't free.
(dot_cfi_escape): Use notes_alloc.
(cfi_finish): Free cies after each pass, not before.  Clear
out static vars too.
gas/dw2gencfi.c