mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
6394c35a7d
commit
983fffd431
|
@ -702,8 +702,9 @@ ShellOpenFileByName(
|
||||||
}
|
}
|
||||||
PathCleanUpDirectories (FileNameCopy);
|
PathCleanUpDirectories (FileNameCopy);
|
||||||
if (PathRemoveLastItem (FileNameCopy)) {
|
if (PathRemoveLastItem (FileNameCopy)) {
|
||||||
ShellCreateDirectory (FileNameCopy, FileHandle);
|
if (!EFI_ERROR(ShellCreateDirectory (FileNameCopy, FileHandle))) {
|
||||||
ShellCloseFile (FileHandle);
|
ShellCloseFile (FileHandle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SHELL_FREE_NON_NULL (FileNameCopy);
|
SHELL_FREE_NON_NULL (FileNameCopy);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue