Reviewed-by: Jaben Carsey <[email protected]>

> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Sunday, March 13, 2016 7:14 PM
> To: Qiu, Shumin <[email protected]>; [email protected]
> Cc: Carsey, Jaben <[email protected]>
> Subject: RE: [PATCH] ShellPkg: Fix Shell ASSERT when read 'TAB' key fail from
> 'ConIn'.
> Importance: High
> 
> 
> 
> Reviewed-by: Ruiyu Ni <[email protected]>
> >-----Original Message-----
> >From: Qiu, Shumin
> >Sent: Sunday, March 13, 2016 3:58 PM
> >To: [email protected]
> >Cc: Carsey, Jaben <[email protected]>; Ni, Ruiyu <[email protected]>
> >Subject: [PATCH] ShellPkg: Fix Shell ASSERT when read 'TAB' key fail from
> 'ConIn'.
> >
> >Free 'FoundFileList' when read 'TAB' key fail to avoid memory leak and
> ASSERT.
> >
> >Cc: Jaben Carsey <[email protected]>
> >Cc: Ruiyu Ni <[email protected]>
> >Contributed-under: TianoCore Contribution Agreement 1.0
> >Signed-off-by: Qiu Shumin <[email protected]>
> >---
> > ShellPkg/Application/Shell/FileHandleWrappers.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> >diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c
> b/ShellPkg/Application/Shell/FileHandleWrappers.c
> >index 1a0c999..0e5efe3 100644
> >--- a/ShellPkg/Application/Shell/FileHandleWrappers.c
> >+++ b/ShellPkg/Application/Shell/FileHandleWrappers.c
> >@@ -572,8 +572,7 @@ FileInterfaceStdInRead(
> >             TabLinePos = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FoundFileList-
> >Link);
> >             InTabScrolling = TRUE;
> >           } else {
> >-            FreePool(FoundFileList);
> >-            FoundFileList = NULL;
> >+            ShellInfoObject.NewEfiShellProtocol->FreeFileList 
> >(&FoundFileList);
> >           }
> >         }
> >       }
> >@@ -856,6 +855,9 @@ FileInterfaceStdInRead(
> >   // if this was used it should be deallocated by now...
> >   // prevent memory leaks...
> >   //
> >+  if (FoundFileList != NULL) {
> >+    ShellInfoObject.NewEfiShellProtocol->FreeFileList (&FoundFileList);
> >+  }
> >   ASSERT(FoundFileList == NULL);
> >
> >   return Status;
> >--
> >2.7.1.windows.2

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to