Re: [PATCH] string_list_dollar_atstar: fix leak

Chet Ramey <[email protected]> Thu, 21 May 2026 13:13:47 -0400
Newsgroups gmane.comp.shells.bash.bugs
Organization ITS, Case Western Reserve University
Message-ID <[email protected]>
On 5/20/26 7:34 PM, Grisha Levit wrote:
> 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

Thanks for the report. Cleaner to call dispose_words(l2) after the call to
word_list_split(l2).

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc (application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE-----

wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCag89SwUDAAAAAAAKCRC7WGnwZOp0q+hT
AKCZTFazT6dvrQNYNoTHlal8ubdE/QCgjQLTw/HkEqxXeDzTtI4GqnyqAUE=
=fUad
-----END PGP SIGNATURE-----