Memory leak in ash with script using "local" incorrectly
Rafał Miłecki
zajec5 at gmail.com
Thu Oct 29 06:04:39 UTC 2015
Hi,
I incorrectly used "local" in my script assuming it's allowed in a
while loop. Minimal test-case:
while [ 1 ]; do local foo=$(date); done
BusyBox's ash never complained but it was leaking a memory.
I don't know if such incorrect usage is worth any warning. For a
reference, bash does this:
> local: can only be used in a function
However I guess it would be nice thing to stop memory leak, even if
script code is incorrect. Could someone take a look at this, please?
My BusyBox/ash version:
BusyBox v1.23.2 (2015-07-12 11:22:27 CEST) built-in shell (ash)
--
Rafał
More information about the busybox
mailing list