[v9,06/11] Memory leak in gas do_repeat

Message ID 20230302220408.1925678-7-binutils@emagii.com
State Repeat Merge
Headers
Series [v9,01/11,gdb/testsuite] Fix gdb.rust/watch.exp on ppc64le |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Frager, Neal via Binutils March 2, 2023, 10:04 p.m. UTC
  From: Alan Modra <amodra@gmail.com>

	* read.c (do_repeat): Free sb on error path.
---
 gas/read.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/gas/read.c b/gas/read.c
index f1099cba1a3..d43584be28c 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -3029,6 +3029,7 @@  do_repeat (size_t count, const char *start, const char *end,
   if (!buffer_and_nest (start, end, &one, get_non_macro_line_sb))
     {
       as_bad (_("%s without %s"), start, end);
+      sb_kill (&one);
       return;
     }