Revision: 19522
          http://sourceforge.net/p/edk2/code/19522
Author:   shenshushi
Date:     2015-12-24 08:25:52 +0000 (Thu, 24 Dec 2015)
Log Message:
-----------
ShellPkg: Fix the TAB-auto-completion memory leak.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Ruiyu Ni <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Application/Shell/Shell.c

Modified: trunk/edk2/ShellPkg/Application/Shell/Shell.c
===================================================================
--- trunk/edk2/ShellPkg/Application/Shell/Shell.c       2015-12-24 08:14:51 UTC 
(rev 19521)
+++ trunk/edk2/ShellPkg/Application/Shell/Shell.c       2015-12-24 08:25:52 UTC 
(rev 19522)
@@ -1205,6 +1205,7 @@
   CONST CHAR16  *CurDir;
   UINTN         BufferSize;
   EFI_STATUS    Status;
+  LIST_ENTRY    OldBufferList;
 
   CurDir  = NULL;
 
@@ -1218,6 +1219,7 @@
     return EFI_OUT_OF_RESOURCES;
   }
 
+  SaveBufferList(&OldBufferList);
   CurDir = ShellInfoObject.NewEfiShellProtocol->GetEnv(L"cwd");
 
   //
@@ -1247,6 +1249,7 @@
   //
   // Done with this command
   //
+  RestoreBufferList(&OldBufferList);
   FreePool (CmdLine);
   return Status;
 }


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to