Fix memory leak in RiscV assembler.
authorNick Clifton <nickc@redhat.com>
Mon, 2 Oct 2023 15:23:14 +0000 (16:23 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 2 Oct 2023 15:23:14 +0000 (16:23 +0100)
  PR 30861
  * config/tc-riscv.c (riscv_insert_uleb128_fixes): Release duplicated memory.

gas/ChangeLog
gas/config/tc-riscv.c

index c6e730f5dcd563d2698f33fdf0546b797f3b22f3..fef3c248196ef217f25ea564d3037afbb685ba0e 100644 (file)
@@ -1,3 +1,9 @@
+2023-10-02  Nick Clifton  <nickc@redhat.com>
+
+       PR 30861
+       * config/tc-riscv.c (riscv_insert_uleb128_fixes): Release
+       duplicated memory.
+
 2023-09-18  Jacob Navia  <jacob@jacob.remcomp.fr>
 
        * config/tc-riscv.c (riscv_ip_hardcode): Fully initialise the
index 0b8ecf9668171a7efac5b3bf383c8fecb547e860..4b7ff6dcc438e65fb5eff740fe609584c0ef3aa6 100644 (file)
@@ -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);
     }
 }