}\r
\r
CorrectedPath = StrnCatGrow(&CorrectedPath, &LongestPath, RootPath, 0);\r
+ if (CorrectedPath == NULL) {\r
+ return SHELL_OUT_OF_RESOURCES;\r
+ }\r
if (CorrectedPath[StrLen(CorrectedPath)-1] != L'\\'\r
&&CorrectedPath[StrLen(CorrectedPath)-1] != L'/') {\r
CorrectedPath = StrnCatGrow(&CorrectedPath, &LongestPath, L"\\", 0);\r
ASSERT((FullPath == NULL && Size == 0) || (FullPath != NULL));\r
if (StrStr(PathName, L":") == NULL) {\r
StrnCatGrow(&FullPath, &Size, gEfiShellProtocol->GetCurDir(NULL), 0);\r
+ if (FullPath == NULL) {\r
+ ShellCommandLineFreeVarList (Package);\r
+ return SHELL_OUT_OF_RESOURCES;\r
+ }\r
}\r
StrnCatGrow(&FullPath, &Size, PathName, 0);\r
+ if (FullPath == NULL) {\r
+ ShellCommandLineFreeVarList (Package);\r
+ return SHELL_OUT_OF_RESOURCES;\r
+ }\r
+ \r
if (ShellIsDirectory(PathName) == EFI_SUCCESS) {\r
//\r
// is listing ends with a directory, then we list all files in that directory\r