From 96beb5ced9f3763dba142c15614476e043af3b43 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 10 Jun 2025 16:56:41 +0100 Subject: [PATCH] 53738: Fix memory leak in command substitution. This happened if the substituion had a here document but the parse failed. --- ChangeLog | 5 +++++ Src/parse.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index cd9b5bdca..10430913d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-06-10 Peter Stephenson + + * 53738: Src/parse.c: memory leak in here doc in failed command + substitution. + 2025-06-05 Mikael Magnusson * unposted: Completion/Unix/Command/_subversion: fix return diff --git a/Src/parse.c b/Src/parse.c index 8edc701f4..4ce5a4650 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -340,6 +340,7 @@ parse_context_restore(const struct parse_stack *ps, int toplevel) inrepeat_ = ps->inrepeat_; intypeset = ps->intypeset; + clear_hdocs(); hdocs = ps->hdocs; eclen = ps->eclen; ecused = ps->ecused; @@ -583,6 +584,7 @@ empty_eprog(Eprog p) return (!p || !p->prog || *p->prog == WCB_END()); } +/**/ static void clear_hdocs(void) {