diff options
author | Jaben Carsey <jaben.carsey@intel.com> | 2015-07-28 20:22:26 +0000 |
---|---|---|
committer | jcarsey <jcarsey@Edk2> | 2015-07-28 20:22:26 +0000 |
commit | 983fffd4310ad3c532794ac923b3d55a1da14093 (patch) | |
tree | aea66a035cfbcf90f49c24b5fd774f736a4d185b /ShellPkg/Library/UefiShellLib | |
parent | 6394c35a7db3d7a7cc68f491179a45fe430a335a (diff) | |
download | edk2-platforms-983fffd4310ad3c532794ac923b3d55a1da14093.tar.xz |
ShellPkg: prevent Close call when Open failed
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hp.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18096 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellLib')
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 0c99e23650..6e0f61130f 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -702,8 +702,9 @@ ShellOpenFileByName( }
PathCleanUpDirectories (FileNameCopy);
if (PathRemoveLastItem (FileNameCopy)) {
- ShellCreateDirectory (FileNameCopy, FileHandle);
- ShellCloseFile (FileHandle);
+ if (!EFI_ERROR(ShellCreateDirectory (FileNameCopy, FileHandle))) {
+ ShellCloseFile (FileHandle);
+ }
}
SHELL_FREE_NON_NULL (FileNameCopy);
}
|