busybox/shell/hush_test/hush-vars/var_leaks.tests
Denis Vlasenko afd7a8d744 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
2008-10-09 16:29:44 +00:00

15 lines
174 B
Plaintext
Executable File

# 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