aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index eb1347447..31fbc550a 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8677,8 +8677,17 @@ expredir(union node *n)
8677#if ENABLE_ASH_BASH_COMPAT 8677#if ENABLE_ASH_BASH_COMPAT
8678 store_expfname: 8678 store_expfname:
8679#endif 8679#endif
8680#if 0
8681// By the design of stack allocator, the loop of this kind:
8682// while true; do while true; do break; done </dev/null; done
8683// will look like a memory leak: ash plans to free expfname's
8684// of "/dev/null" as soon as it finishes running the loop
8685// (in this case, never).
8686// This "fix" is wrong:
8680 if (redir->nfile.expfname) 8687 if (redir->nfile.expfname)
8681 stunalloc(redir->nfile.expfname); 8688 stunalloc(redir->nfile.expfname);
8689// It results in corrupted state of stacked allocations.
8690#endif
8682 redir->nfile.expfname = fn.list->text; 8691 redir->nfile.expfname = fn.list->text;
8683 break; 8692 break;
8684 case NFROMFD: 8693 case NFROMFD: