Hi Chet, Thanks for your reply.
On Thu, 11 Jun 2015 10:54:31 -0400, Chet Ramey wrote: > On 6/9/15 3:42 PM, Jean Delvare wrote: > > > I think I have a minimal test case now: > > > > #!/bin/bash > > > > declare -a ARRAY > > > > ARRAY[0]=foo > > FOO=${ARRAY[0]} # <-- leaks > > echo $FOO > > > > And a candidate fix: > > > > bash 4.3: Fix memory leak in parameter_brace_expand_word > > Thanks for the report. This is the right place for the patch. I made > this change back in October 2014 as part of an unrelated fix for an > array element quoting issue. > > (Your patch reuses `temp', but array_variable_part returns a SHELL_VAR *.) Good point. gcc warns about it but I did not pay attention, sorry about that. As we do not use the result of function array_variable_part, I think the easiest way to fix the warning is to not assign it to any variable. I'll submit an updated patch. Thanks again, -- Jean Delvare SUSE L3 Support