From dc63d5682e48ab64724a2da2ee803cd13bf5f0c0 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 2 Oct 2023 16:23:14 +0100 Subject: [PATCH] Fix memory leak in RiscV assembler. PR 30861 * config/tc-riscv.c (riscv_insert_uleb128_fixes): Release duplicated memory. --- gas/ChangeLog | 6 ++++++ gas/config/tc-riscv.c | 1 + 2 files changed, 7 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index c6e730f5dcd..fef3c248196 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2023-10-02 Nick Clifton + + PR 30861 + * config/tc-riscv.c (riscv_insert_uleb128_fixes): Release + duplicated memory. + 2023-09-18 Jacob Navia * config/tc-riscv.c (riscv_ip_hardcode): Fully initialise the diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 0b8ecf96681..4b7ff6dcc43 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -4999,6 +4999,7 @@ riscv_insert_uleb128_fixes (bfd *abfd ATTRIBUTE_UNUSED, exp_dup->X_add_symbol = exp->X_op_symbol; fix_new_exp (fragP, fragP->fr_fix, 0, exp_dup, 0, BFD_RELOC_RISCV_SUB_ULEB128); + free ((void *) exp_dup); } } -- 2.30.2