From 594e780bb9391b6cc991ca8670a86195b8269337 Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Thu, 24 Dec 2015 08:25:52 +0000 Subject: [PATCH] ShellPkg: Fix the TAB-auto-completion memory leak. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Ruiyu Ni git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19522 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/Shell.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.39.2