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
This commit is contained in:
1
shell/hush_test/hush-vars/var_leaks.right
Normal file
1
shell/hush_test/hush-vars/var_leaks.right
Normal file
@@ -0,0 +1 @@
|
||||
OK
|
14
shell/hush_test/hush-vars/var_leaks.tests
Executable file
14
shell/hush_test/hush-vars/var_leaks.tests
Executable file
@@ -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
|
Reference in New Issue
Block a user