diff options
author | Qiu Shumin <shumin.qiu@intel.com> | 2016-03-11 13:32:52 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-13 20:42:30 +0800 |
commit | adeae3bcda06cb0a6b3fe4b8df741d0ee9ba33b7 (patch) | |
tree | 21942c22ef084c4a5c1b959e3ddda6966e4fd842 | |
parent | e9223dc34eaedf0c0f198765d4c86f73d37e3387 (diff) | |
download | edk2-platforms-adeae3bcda06cb0a6b3fe4b8df741d0ee9ba33b7.tar.xz |
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>
(cherry picked from commit 9c17810a3635f6c0ca2afa78e3ec05bbb807d4be)
-rw-r--r-- | ShellPkg/Application/Shell/FileHandleWrappers.c | 6 |
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;
|