summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-vars/var_leaks.tests
diff options
context:
space:
mode:
authorDenis Vlasenko2008-10-09 16:29:44 +0000
committerDenis Vlasenko2008-10-09 16:29:44 +0000
commitafd7a8d744b29daaedbba1969307bd9ce17e7dc3 (patch)
tree015fa25e84f72a32b31724add0969f51a03bb74d /shell/hush_test/hush-vars/var_leaks.tests
parent07e05c100fe6ac2bc5aa3505daabb55224c06a1f (diff)
downloadbusybox-afd7a8d744b29daaedbba1969307bd9ce17e7dc3.zip
busybox-afd7a8d744b29daaedbba1969307bd9ce17e7dc3.tar.gz
hush: fix environment and memory leaks, add tests for them
function old new delta add_malloced_string_to_strings - 110 +110 run_list 1999 2086 +87 free_strings_and_unsetenv - 87 +87 hush_version_str - 18 +18 pseudo_exec_argv 139 146 +7 static.version_str 17 - -17 free_pipe 237 210 -27 done_word 790 642 -148 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 2/2 up/down: 309/-192) Total: 117 bytes
Diffstat (limited to 'shell/hush_test/hush-vars/var_leaks.tests')
-rwxr-xr-xshell/hush_test/hush-vars/var_leaks.tests14
1 files changed, 14 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/var_leaks.tests b/shell/hush_test/hush-vars/var_leaks.tests
new file mode 100755
index 0000000..27c8c65
--- /dev/null
+++ b/shell/hush_test/hush-vars/var_leaks.tests
@@ -0,0 +1,14 @@
+# external program
+a=b /bin/true
+env | grep ^a=
+
+# builtin
+a=b true
+env | grep ^a=
+
+# exec with redirection only
+# in bash, this leaks!
+a=b exec 1>&1
+env | grep ^a=
+
+echo OK