Revision: 19534
          http://sourceforge.net/p/edk2/code/19534
Author:   hwu1225
Date:     2015-12-25 02:12:50 +0000 (Fri, 25 Dec 2015)
Log Message:
-----------
ShellPkg: Fix the TAB-auto-completion memory leak.

(Sync patch r19522 from main trunk.)

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

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/19522

Modified Paths:
--------------
    branches/UDK2015/ShellPkg/Application/Shell/Shell.c

Modified: branches/UDK2015/ShellPkg/Application/Shell/Shell.c
===================================================================
--- branches/UDK2015/ShellPkg/Application/Shell/Shell.c 2015-12-25 02:12:21 UTC 
(rev 19533)
+++ branches/UDK2015/ShellPkg/Application/Shell/Shell.c 2015-12-25 02:12:50 UTC 
(rev 19534)
@@ -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