summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2016-03-11 13:32:52 +0800
committerQiu Shumin <shumin.qiu@intel.com>2016-03-14 16:24:46 +0800
commit9c17810a3635f6c0ca2afa78e3ec05bbb807d4be (patch)
treed816b7f79948188005c6accd186797c938a8d656
parent53c1329529e47a7da3a0bb5169b5fe0b44f4307e (diff)
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 <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
-rw-r--r--ShellPkg/Application/Shell/FileHandleWrappers.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c b/ShellPkg/Application/Shell/FileHandleWrappers.c
index 1a0c9992ab..0e5efe3025 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;