summaryrefslogtreecommitdiff
path: root/ShellPkg/Application
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2015-12-24 08:25:52 +0000
committershenshushi <shenshushi@Edk2>2015-12-24 08:25:52 +0000
commit594e780bb9391b6cc991ca8670a86195b8269337 (patch)
treea71cd89739d7bdc5627dbbfb89c2ea030668160d /ShellPkg/Application
parent14810d6b644d367d4f195b3e953145a27493538c (diff)
downloadedk2-platforms-594e780bb9391b6cc991ca8670a86195b8269337.tar.xz
ShellPkg: Fix the TAB-auto-completion memory leak.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19522 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Application')
-rw-r--r--ShellPkg/Application/Shell/Shell.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index 465f4f3974..40ae68d5a8 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -1205,6 +1205,7 @@ DoShellPrompt (
CONST CHAR16 *CurDir;
UINTN BufferSize;
EFI_STATUS Status;
+ LIST_ENTRY OldBufferList;
CurDir = NULL;
@@ -1218,6 +1219,7 @@ DoShellPrompt (
return EFI_OUT_OF_RESOURCES;
}
+ SaveBufferList(&OldBufferList);
CurDir = ShellInfoObject.NewEfiShellProtocol->GetEnv(L"cwd");
//
@@ -1247,6 +1249,7 @@ DoShellPrompt (
//
// Done with this command
//
+ RestoreBufferList(&OldBufferList);
FreePool (CmdLine);
return Status;
}