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>
This commit is contained in:
Jon Tollefson 2012-11-13 19:26:53 +01:00 committed by Denys Vlasenko
parent e4b9451413
commit 4ba6c5d3ba

View File

@ -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: