]> git.proxmox.com Git - mirror_edk2.git/commit
ShellPkg/App: Fix memory leak and save resources.
authorMarvin H?user <Marvin.Haeuser@outlook.com>
Thu, 19 May 2016 19:04:02 +0000 (03:04 +0800)
committerQiu Shumin <shumin.qiu@intel.com>
Wed, 25 May 2016 02:16:46 +0000 (10:16 +0800)
commitbd3fc8133b2b17ad2e0427d1bf6b44b08cf2f3b2
treedeff7cd5734e2a08add8dbb4cdf05dc2a9d0ec4d
parentdc99315b8732b6e3032d01319d3f534d440b43d0
ShellPkg/App: Fix memory leak and save resources.

1) RunSplitCommand() allocates the initial SplitStdOut via
   CreateFileInterfaceMem(). Free SplitStdIn after the swap to fix
   the memory leak.

2) In RunSplitCommand(), SplitStdOut is checked for equality with
   StdIn. This cannot happen due to the if-check within the swap.
   Hence remove it.

3) UefiMain() doesn't free SplitList. Delete all list entries and
   reinitialize the list when in DEBUG. This does not include the
   CreateFileInterfaceMem()-allocated SplitStd mentioned in 1), so
   keep the ASSERT() until resolved.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
ShellPkg/Application/Shell/Shell.c