diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-09 14:15:57 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-09 14:15:57 +0000 |
commit | 1943aec2ec390d9fda159aa0412362780ec83f09 (patch) | |
tree | ec9ddd365d2232d9fb621b79000cbf20f1410cda /shell/hush_test/hush-z_slow/leak_heredoc1.tests | |
parent | efea9d2819165b414b81a47c8227ae007bd5382a (diff) |
hush: plug the leak of expanded heredoc
Diffstat (limited to 'shell/hush_test/hush-z_slow/leak_heredoc1.tests')
-rwxr-xr-x | shell/hush_test/hush-z_slow/leak_heredoc1.tests | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/shell/hush_test/hush-z_slow/leak_heredoc1.tests b/shell/hush_test/hush-z_slow/leak_heredoc1.tests new file mode 100755 index 000000000..26cbb28a4 --- /dev/null +++ b/shell/hush_test/hush-z_slow/leak_heredoc1.tests @@ -0,0 +1,34 @@ +echo "Warm up" +i=1 +while test $i != 99; do + : <<HERE +Hello $i `echo builtin_$i` +HERE + : $((i++)) +done + +memleak + +echo "Measuring memory leak..." +i=1 +while test $i != 99; do + : <<HERE +Hello $i `echo builtin_$i` +HERE + : $((i++)) +done +i=1 +while test $i != 99; do + : <<HERE +Hello $i `echo builtin_$i` +HERE + : $((i++)) +done + +memleak +kb=$? +if test $kb -le 4; then + echo Ok #$kb +else + echo "Bad: $kb kb (or more) leaked" +fi |