]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Free the returned string of riscv_arch_str if we call it multiple times
authorNelson Chu <nelson@rivosinc.com>
Thu, 13 Mar 2025 02:31:35 +0000 (10:31 +0800)
committerNelson Chu <nelson@rivosinc.com>
Tue, 18 Mar 2025 04:15:11 +0000 (12:15 +0800)
commit433ccc440b51673ed3fce85a8dedca24f16ccab2
tree119a85a613c8eb377472acbc39d86251553dfe14
parent921d65b3f0751b714f9859496946e9560001b18f
RISC-V: Free the returned string of riscv_arch_str if we call it multiple times

The string returned from riscv_arch_str is allocated by xmalloc, so once we
called it multiple times, we should keep the newest one for the output elf
architecture attribute, but free the remaining unused strings.
bfd/elfnn-riscv.c