PR 32391 memory leak

Message ID Z3U2_es6dEcGdqg0@squeak.grove.modra.org
State New
Headers
Series PR 32391 memory leak |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Alan Modra Jan. 1, 2025, 12:37 p.m. UTC
  This one will need reverting too if Nick backs out the PR 32391 patch.

	* macro.c (sub_actual): Free newadd.
  

Patch

diff --git a/gas/macro.c b/gas/macro.c
index 9670b38c152..9eefc8360b1 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -878,6 +878,7 @@  sub_actual (size_t start, sb *in, sb *t, struct htab *formal_hash,
 	      (void) macro_expand_body (add, &newadd, NULL, NULL,
 					orig_macro, orig_macro->count);
 	      sb_add_sb (out, &newadd);
+	      sb_kill (&newadd);
 	    }
 	  else
 	    {