On 4/20/22 1:28 PM, Robert E. Griffith wrote:
I am calling all_visible_functions() in my loadable builtin. When I am done
with the SHELL_VAR** it returns, should I xfree() it?
Yes.
The reason I am asking is I followed the two places its called in the code
and I don't see it being freed. They are pretty complicated so I could just
be missing it but I thought I would ask. I believe that the returned
variable is allocated in vlist_alloc() in variables.c.
I'll look at the one in the programmable completion code. valgrind doesn't
report any leaks there.
And while I am asking, what is the concept of invisible variables and
functions? Do they correspond to something we see in BASH scripts or is it
an optimization detail?
`Invisible' variables are variables that have been assigned attributes but
not values, so they are technically unset.