summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorJon Tollefson <kniht@linux.vnet.ibm.com>2012-11-13 18:26:53 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2012-11-13 18:26:53 (GMT)
commit4ba6c5d3ba3d2c7922aff6b5c2e73b8325f1cf17 (patch)
tree2d4fca6585c985d96463c2eb2f4ac548d046f006 /shell/ash.c
parente4b9451413013388757cf48fbb16d8137ddd1ccb (diff)
downloadbusybox-4ba6c5d3ba3d2c7922aff6b5c2e73b8325f1cf17.tar.gz
busybox-4ba6c5d3ba3d2c7922aff6b5c2e73b8325f1cf17.tar.bz2
ash: fix a memory leak
The script which triggers the leak: while true do while true do break; done</dev/null done Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 010924d..dda18e8 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8676,6 +8676,8 @@ expredir(union node *n)
#if ENABLE_ASH_BASH_COMPAT
store_expfname:
#endif
+ if (redir->nfile.expfname)
+ stunalloc(redir->nfile.expfname);
redir->nfile.expfname = fn.list->text;
break;
case NFROMFD: