With the latest devel commit [1], LeakSanitizer reports:

    $ bash -c 'IFS=,; $@' - :
    ...
    Direct leak of 16 byte(s) in 1 object(s) allocated from:
        #1 0x0000008cf24c in xmalloc xmalloc.c:104:10
        #2 0x0000005c63b4 in make_word_list make_cmd.c:156:3
        #3 0x0000006fb658 in string_list_dollar_atstar subst.c:3158:12
        #4 0x0000006fda80 in string_list_pos_params subst.c:3259:11

[1] https://git.gnu.org/cgit/bash.git/commit/?id=2d4ba0c6
---
 subst.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/subst.c b/subst.c
index e4dffd34..1ec43b53 100644
--- a/subst.c
+++ b/subst.c
@@ -3169,11 +3169,11 @@ string_list_dollar_atstar (WORD_LIST *list, int quoted, 
int flags)
 
   /* We want to turn words that are QUOTED_NULL with W_HASQUOTEDNULL set in
      the word flags back into "" but leave every other $'\177' alone. */
-  for (l2 = l; l2; l2 = l2->next)
-    if (QUOTED_NULL (l2->word->word) && (l2->word->flags & W_HASQUOTEDNULL))
+  for (tl = l; tl; tl = tl->next)
+    if (QUOTED_NULL (tl->word->word) && (tl->word->flags & W_HASQUOTEDNULL))
       {
-       l2->word->word[0] = '\0';
-       l2->word->flags &= ~W_HASQUOTEDNULL;
+       tl->word->word[0] = '\0';
+       tl->word->flags &= ~W_HASQUOTEDNULL;
       }
    
   list_quote_escapes (l);
-- 
2.54.0


Reply via email to